I have created my
gitignore file and have added it to my local repo. I understand that I have to do
git rm --cached. So here are my questions.
- When in the process should I do
git rm --cached? before
git add --all .or
git commit -m "comments"or
git push origin master? Also before or after committing (or pushing) my
git rm --cachedthe whole command? or must I always qualify it with, for example,
git rm --cached /bin/*?
- my mac computer gave me a warning about naming my file
android.gitignore. If I simply do
.gitignorethe file will be hidden. Does github care which one I do?
git rm --cached filename is used to stop tracking a file without deleting it from your working tree. Example: You create a new file, start tracking with git add, and then commit. You want to ignore the file, so you add it to .gitignore git is still tracking the file when you make changes to it, this is when you git rm --cached git thinks the file is gone, but it's still there in your local directory.
git rm --cached filename for whichever file you want to ignore.
yes, it needs to be .gitignore