Why are there two ways to unstage a file in Git?

后端 未结 12 1843
刺人心
刺人心 2020-11-27 23:48

Sometimes git suggests git rm --cached to unstage a file, sometimes git reset HEAD file. When should I use which?

EDIT:

D:\         


        
12条回答
  •  执笔经年
    2020-11-28 00:41

    It would seem to me that git rm --cached removes the file from the index without removing it from the directory where a plain git rm would do both, just as an OS rm would remove the file from the directory without removing its versioning.

提交回复
热议问题