Git rm several files?

前端 未结 11 1962
长发绾君心
长发绾君心 2020-12-15 05:08

How do I easily remove several files without manually typing the full paths of all of them to git rm? I have plenty of modified files I\'d like to keep so remov

11条回答
  •  萌比男神i
    2020-12-15 05:30

    Easy way:

    • Delete files in your file explorer
    • use git ls-files --deleted | xargs git add to stage them. They will be removed in the remote once you push.

    Git way: Referencing what @CpILL said (https://stackoverflow.com/a/34889424/6538751) use

    • find . -name 'DeleteMe*.cs' -exec git rm {} \;

    you can utilize wildcards.

提交回复
热议问题