gpt4 book ai didi

git rm -r some-file => 如果路径不存在,则 git 以 1 退出

转载 作者:行者123 更新时间:2023-12-05 01:46:03 26 4
gpt4 key购买 nike

我正在寻找一种使用方法

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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com