我通过使用创建了一个列表
$ git stash show --name-only | grep -i "Kopie"
输出:
A - Kopie.txt
B - Kopie.txt
如何取消隐藏列表中的所有文件?
第一种方法:
$ git stash show --name-only | grep -i "Kopie" | xargs git checkout stash@{0} --
结果:
error: pathspec 'A' did not match any file(s) known to git. error: pathspec '-' did not match any file(s) known to git. error: pathspec 'Kopie.txt' did not match any file(s) known to git. error: pathspec 'B' did not match any file(s) known to git. error: pathspec '-' did not match any file(s) known to git. error: pathspec 'Kopie.txt' did not match any file(s) known to git.
当文件名传递给 时,您没有引用文件名
git checkout
,因此A
,-
&Kopie.txt
被视为不同的文件。尝试将
-I {}
选项添加到xargs
,然后将引号括起来{}
: