.gitignore and web.release.config
Asked Answered
R

3

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?

Remonstrate answered 1/10, 2014 at 13:18 Comment(2)
You have no trailing characters there?Depersonalize
Not one, checked multiple timesRemonstrate
A
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.

Admass answered 7/10, 2014 at 11:46 Comment(6)
The file is already removed from the repository, also git doesn't show it in 'git status'. It is visual studio that is trying to add it.Remonstrate
please check whether this file 'Web.Release.config' exists in your project folder. and add entire path of your file in '.gitignore' file.Admass
Yes it exists, as you can see in the pictures above. I've also tried with the full path of the file, no successRemonstrate
after adding that file path in .gitignore execute above three commands once.Admass
Yes, I've already done that, the file is not in the repositoryRemonstrate
Please check this link #25908953 it may help youAdmass
P
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.

Prefrontal answered 9/10, 2014 at 15:57 Comment(1)
Yes, it definitely seems to be a problem with VSRemonstrate
B
-1

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.

Barreto answered 10/10, 2014 at 11:14 Comment(1)
It was in another encoding, but I've already changed it and no effectRemonstrate

© 2022 - 2024 — McMap. All rights reserved.