First of all, I've seen .vs\config\applicationhost.config in source control.
We are working in a team and Visual Studio changes some path inside applicationhost.config
file. We need to exclude this. In my .gitignore
file, I've added:
/.vs/config/applicationhost.config
However, in every commit, this is again added to the git. Before VS2015 Update 2, it was no issue, but something has changed to git integration with VS after this update and now it's being included. Whenever my workmates pull changes to the branch, their IIS Express fails because of the changes to this file (it has paths local to my own PC's paths etc.) and vice versa.
How do I pull this file out of the source control completely?
The location of the file is currently in the %windir%\system32\inetsrv\config directory.
No, you should not add it to source control. The purpose of this folder is to move machine- and user-specific files to a central location. The explanation on the Visual Studio User Voice issue explains it well: So far, we have moved the .
The purpose of gitignore files is to ensure that certain files not tracked by Git remain untracked. To stop tracking a file that is currently tracked, use git rm --cached.
Do you have applicationhost.config
file already in repository before adding it to .gitignore
file?
If so you need to use command git rm --cached [file]
.
Purpose of .gitignore
file is to keep untracked files untracked, so it wont affect files that you already track.
EDIT:
As I totally forgot: Above solution works for repository, so all developers working will be forced to maintain their own copy.
To prevent git from detecting changes you should also use this:
git update-index --assume-unchanged [path_or_file]
And if - in future - you would want to start tracking changes again you'll need to revert update via:
git update-index --no-assume-unchanged <file>
And to see files marked with --assume-uchanged
flag you can use this:
git ls-files -v | grep '^[[:lower:]]'
See documentation for git ls-files.
I believe this blog entry can be more descriptive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With