At first, I always use "git add ." in the work, but I some times, I find if I remove some files in the track tree,and then push the "New Version" to remote git server, then I still can find the removed files in native git. so how is it? I need to delete the files in the server. So I will do like this:
For File:
git rm --cached filename
git commit -m "delete file in remote git."
git push [origin] [master]
For Folder:
git rm -r --cached foldername
git commit -m "delete folder in remote git."
git push [origin] [master]
It is so non-convenient,right? So how to avoid doing like this?
Way is using "git add --all"
"git add --all" == "git add ." + "git add -u"
"git add ." means track all the files that "new" and "modified";
"git add -u" means track all the files that "modified" and "deleted"
So in the project, if you just use "git add ." to track all the files, it will be work ok, but you should deal with all the dirty files in the remote git server.
Reference link:http://stackoverflow.com/questions/572549/difference-between-git-add-a-and-git-add
Thanks,
Blues