.gitignore and web.release.config

I'm trying to remove my web.release.config from my GIT repository, so I removed it from GIT using git rm

and then added it to my .gitignore file.

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

This is the line in the gitignore file:

Web.Release.config

      

But it is added:

enter image description here

enter image description here

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

+3


source to share


3 answers


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

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

  • Refer to this question once.



+5


source


This may not be the "correct" answer, but I find Visual Studio is messing around. I was experiencing the same issue with Visual Studio 2013 when I tried to exclude NuGet packages from the repository. git status

shows nothing while VS is still screaming that there are hundreds of files waiting to be added. I ended up just using the Git Client (Git Extension, bundled with the Git installer) and completely ignoring the Team Explorer tab in VS.



+2


source


Open the file .gitignore

in a real text editor and make sure the encoding is UTF-8 . Other encoding (like UTF-16LE) can cause this problem.

0


source







All Articles