when I modify or add files in local working directory, I can following these 3 steps to update the remote repo
git add .
git commit -m "message"
git push
if I delete file(s) in local working directory, for the first step I need to use git rm file_name
instead of git add
then how about if I not only add some files but also delete some other files at the same time? what steps should I follow?
git add .
, then the remote repo won't change. what single commit can include addition/deletion and modification?git add .
to add a single file; that adds the entire current working directory (that's what the.
means, after all). That would cancel out yourgit rm file_name
. Usegit add yourFileName
. And keep in mind thatadd
,rm
, etc. never change the remote repository. Only committing and pushing your changes will change the remote repository.