git rm —cached

  • git rm --cached delete file and folder in remote and staging area,keep local file and folder
  • git rm delete file and folder in remote, staging and local area

git local & staging & repo & remote area

git add and git commit -m xxx move specific file from local to staging and repo; we can use git commit -a -m xxx one step and move all the changed files from local to repo. we need to use git push for moving files to remote repo.