Undo git update-index --skip-worktree
A while ago I did this to ignore changes to a file tracked by git:
git update-index --skip-worktree <file>
Now I actually want to commit changes to that file to source. How do I undo the effects of skip-worktree
?
Solution 1:
Aha! I simply want:
git update-index --no-skip-worktree <file>
Solution 2:
According to http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html, use
git ls-files -v
to see the "assume unchanged" and "skip-worktree" files marked with a special letter. The "skip-worktree" files are marked with S
.
Edit: As @amacleod mentioned, making an alias to list all the hidden files is a nice trick to have so that you don't need to remember it. I use alias hidden="git ls-files -v | grep '^S'"
in my .bash_profile. It works great!