繁体   English   中英

Git结帐:星号pathspec不起作用

[英]Git checkout: Asterisk pathspec not working

这工作正常:

git checkout **/pom.xml

但是我们不能对另一个分支运行它

git checkout anotherbranch **/pom.xml
git checkout anotherbranch -- **/pom.xml

error: pathspec '**/pom.xml' did not match any file(s) known to git.

我们使用的是Windows 7 / DOS。

有人知道为什么吗?

请注意,如果没有** ,它可以正常工作。 这将从根目录签出pom.xml。 但是,我们正在尝试检出目录树中的所有pom.xml。

我认为这里发生的是:

Per torek

Shell用当前工作目录中的所有文件名替换* 1,然后执行该操作,然后运行git

我认为当前的分支/工作目录中包含与pathspec匹配的文件,这些文件不在 anotherbranch 当我们尝试有效地运行git checkout anotherbranch unknown_file时,这会导致错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM