.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:
How can I successfully remove web.release.config from git?
source to share
- 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.
source to share
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.
source to share