Git Notes

Clear Git Cache

Sometimes it does not take effect when you append new tries in .gitignore file. This is because the files are already in the repository, you need to untrack the specified file and track it again, then it will respect the new rules.

1
$ git rm -r --cached .

Be careful with this operation, commit your changes first before doing this.

Case sensitive on Windows

By default, Git on windows is not case sensitive. Set the git.core.ignoreCase=false in git configs in %USERPROFILE%\.gitconfig:

1
2
[core]
ignoreCase = false

Now, existing files are tracked and it will not take effect, clear the cache first:

1
$ git rm --cached {path-to-file}