zukatsu.tk => A collection of random notes

created for a reminder of all things that happen in the past
Kategori : Git, Useful Links13 November 2020 09:51:40

Gitignore Ignored By Git

One day I setup gitignore for existing project/repository, the expected result is all file/folder defined on gitignore is ignored by git when doing commit or push, but when I commit/push the code, file and folder defined on gitignore is still pushed to repository. After some google I found that git is likely caching this, and we need to delete this cache to make it work. We can delete this cache with this command :

git rm -r --cached .
git add .
git commit -m "fixed untracked files"

After command above git will exclude ignored file with in gitignore.

ref : https://stackoverflow.com/questions/11451535/gitignore-is-ignored-by-git

Share : Share Facebook Share Twitter
Kategori : Git, Useful Links13 November 2020 09:51:40