我正在寻找一种使用方法
git rm -r some-file some-folder
但如果路径/路径规范不存在,则避免以 1 退出。
我尝试使用 -f
选项,但似乎不起作用。
有人知道我怎样才能做到这一点吗?
最佳答案
使用--ignore-unmatch
选项:
Exit with a zero status even if no files matched.
git rm -r --ignore-unmatch some-file some-folder
关于git rm -r some-file => 如果路径不存在,则 git 以 1 退出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37893967/