5

I'm trying to remove my web.release.config from my GIT repository, so I removed it from git with git rm and then added it to my .gitignore file.

But as soon as I copy again the file into the project, it gets added by Visual Studio to the pending changes.

This is the line in the gitignore file:

Web.Release.config

But it gets added:

enter image description here

enter image description here

How can I successfully remove web.release.config from git?

Escobar5
  • 3,941
  • 8
  • 39
  • 62

3 Answers3

8
  • After adding files to the .gitignore file, to ignore those files we have to execute some commands.
  • To ignore the files which we mentioned in the .gitignore file, we have to execute the following commands.

    git rm -r --cached . git add . git commit -m ".gitignore is now working"

  • Please refer this question once.

Community
  • 1
  • 1
Anjaneyulu Battula
  • 1,910
  • 16
  • 33
2

This might not be a "proper" answer, but I think it's Visual Studio messing around. I've been experiencing the same problem with Visual Studio 2013 when I tried to exclude NuGet packages from the repository. git status shows nothing, while VS still shouting that there're hundreds of files pending to be added. I ended up just use a Git Client (Git Extension, which is bundled with the git installation package) and ignore that Team Explorer tab in VS completely.

Ngoc Pham
  • 443
  • 5
  • 17
0

Open your .gitignore file in a real text editor and verify that the encoding is UTF-8. Other encoding (eg: UTF-16LE) may cause this problem.

David Jacquel
  • 51,670
  • 6
  • 121
  • 147