How does adding files to .gitignore affect existing tracked files in Git?

  • Tracked files are immediately untracked and removed from the repository.
  • Tracked files remain, but changes to them are no longer tracked.
  • Tracked files are ignored only for the current commit.
  • Tracked files are deleted from the working directory, but not the repository.
When files are added to .gitignore, it only affects untracked files. Existing tracked files remain in the repository, and their changes are still tracked unless committed before the addition to .gitignore.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *