1

I want add specific file to be not tracking by git. Im using default Visual Studio .gitignore that was generated by Visual Studio while making solution.

Now, i have a file that i dont want to be tracked. I tried to add this file to .gitignore:

/TaskManager-wpf/Services/UrlBuilder.cs

but when i paste it into last line of .gitignore it not work and when i change this file, Visual Studio TeamExplorer still tracking this file and want to commit changes on it.

My question is, how to add specific code .cs file into .gitignore?

phd
  • 82,685
  • 13
  • 120
  • 165
michasaucer
  • 4,562
  • 9
  • 40
  • 91
  • Possible duplicate of [How to make Git "forget" about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – phd Jun 05 '19 at 12:17

1 Answers1

2

.gitignore will prevent untracked files from being added (without an add -f) to the set of files tracked by git, however, git will continue to track any files that are already being tracked.

you can see the solution here

Bakurits
  • 402
  • 3
  • 11