Unstage all deleted files in Git

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

    Just in case anyone else uses git with PowerShell, here is a powershell version of @jefromi's excellent answer:

    git status --porcelain | where { $_.StartsWith(" D") } | foreach-object { git reset HEAD $_.replace(" D ", "") }
    

提交回复
热议问题