Unstage all deleted files in Git

后端 未结 4 2006
情话喂你
情话喂你 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:22

    The output of git status --porcelain is a great way to build one-liners and scripts for tasks like this:

    git status --porcelain | awk '$1 == "D" {print $2}' | xargs git reset HEAD
    

提交回复
热议问题