git stash apply can';我得不到我真正需要的版本
首先,分支在主分支中,然后 (1)git stash apply can';我得不到我真正需要的版本,git,git-stash,Git,Git Stash,首先,分支在主分支中,然后 (1) git checkout-btest1,然后修改一个文件a.c,并git stash 现在是git藏匿清单 stash@{0}: WIP on test1: 7aa1dbd Merge "RR:AA123" stash@{0}: WIP on test2: 7aa1dbd Merge "RR:AA123" stash@{1}: WIP on test1: 7aa1dbd Merge "RR:AA123" (2) git checkout-btest2,然后
git checkout-btest1
,然后修改一个文件a.c,并git stash
现在是git藏匿清单
stash@{0}: WIP on test1: 7aa1dbd Merge "RR:AA123"
stash@{0}: WIP on test2: 7aa1dbd Merge "RR:AA123"
stash@{1}: WIP on test1: 7aa1dbd Merge "RR:AA123"
(2) git checkout-btest2
,然后修改另一个文件b.c,并git stash
现在是git藏匿清单
stash@{0}: WIP on test1: 7aa1dbd Merge "RR:AA123"
stash@{0}: WIP on test2: 7aa1dbd Merge "RR:AA123"
stash@{1}: WIP on test1: 7aa1dbd Merge "RR:AA123"
(3) 现在,git签出测试
,我想得到修改后的a.c文件,它位于stash@{1}
git stash apply --stash@{1},
找到了b.c.但不是a.c
我是否错过了一些尝试隐藏流行音乐的步骤?您应该使用
git stash apply stash@{1}
不是
--stash@{1}
将作为无效选项被忽略,因此它等于您应该使用的git stash apply
git stash apply stash@{1}
不是
--stash@{1}
将作为无效选项被忽略,因此它等于git stash apply
致命:参数不明确'stash@1“:未知修订或路径不在工作树中。使用“---”将路径与revisions@liumilan它是stash@{1}
而不是stash@1
I将shell从tsch更改为bash,现在git stash apply stash{1}可以工作。为什么它不能在tsch中工作?@liumlan从错误消息中,tsch convertstash{1}
到stash@1
。我真的不知道为什么会发生这种情况。我不使用tcsh
,但我想象shell正在解释花括号。您可能可以单引号引用该参数,这将起作用:git stash apply'stash@{1}'
。致命:参数不明确'stash@1“:未知修订或路径不在工作树中。使用“---”将路径与revisions@liumilan它是stash@{1}
而不是stash@1
I将shell从tsch更改为bash,现在git stash apply stash{1}可以工作。为什么它不能在tsch中工作?@liumlan从错误消息中,tsch convertstash{1}
到stash@1
。我真的不知道为什么会发生这种情况。我不使用tcsh
,但我想象shell正在解释花括号。您可能只需引用一个参数就可以了:git stash apply'stash@{1}
。