I have .gitignore
d .DS_Store
and .gitignore
files. But still see them in the \"git status\".
Can someone explain to me how I can m
If you want to ignore a change to a file that is tracked by git you can specify to git that it should assume that the file has not changed:
git update-index --assume-unchanged file
and to start tracking changes again do:
git update-index --no-assume-unchanged file
if you have already added a file that should be completely ignored (.gitignore) you have to git rm
it first.
reference: https://www.kernel.org/pub/software/scm/git/docs/git-update-index.html
source: http://blog.pagebakers.nl/2009/01/29/git-ignoring-changes-in-tracked-files/
I had an issue getting .DS_Store
ignored where the problem was that it had already been committed to the repo. Removing it resolved the issue.
$ git rm --cached .DS_Store
I had the same exact issue on Mac OS X. I had .gitignore file in the repo but it just won't work.
What was weird when I wanted to print the .gitignore content to the console with the cat
command it printed as it was empty. When opened with vim it appeared as normal.
The solution was to remove the file, create a new one and put the content into it again. After that, ignoring files started to work and when I done cat .gitignore
it printed properly.
This is what your .gitignore
should look like:
.DS_Store
Also, the .gitignore
is meant to be tracked, ignoring it doesn't make sense. So after you've updated the file to contain just .DS_Store
do:
$ git add .gitignore
$ git commit -m "Track .gitignore"
I faced the same problem. None of the .gitignore
lines were in effect.
I converted the file encoding into UTF-8
and it worked instantly.
I experience the same issue. The solution is to add a .gitignore under your home directory first.
My end the repository .gitignore no longer appears in indexing tracking.