Unstage all deleted files in Git

后端 未结 4 1998
情话喂你
情话喂你 2021-02-09 06:14

I want to unstage all file deletes. Is there an easy way?

I want to apply this to the file pattern of all deletes.

4条回答
  •  误落风尘
    2021-02-09 06:46

    In case your path-/filenames returned from git status contain space characters, the call to awk can be modified to include the entire (quoted) path/filename including spaces:

    git status --porcelain|awk '$1 == "D" {print substr($0, index($0,$2))}'|xargs git reset HEAD
    

提交回复
热议问题