由于asked in this question,我也想知道如何解决冲突git stash pop
没有将所有的修改提交(就像“混帐藏匿弹出”没有冲突呢)。如何解决git存储冲突而无需提交?
我目前的做法是非常酷,因为我做这种方式:
git stash pop -> CONFLICT
git stash drop
[resolve conflict]
[add conflict files]
git reset HEAD <all files that are in commit-mode>
[更新]答的方式来重现:
mkdir foo; cd foo; git init
echo "1" > one
echo "2" > two
git add -A; git commit -m "first"
echo "1.1" > one
echo "2.1" > two
git stash
echo "2.2" > two
git commit -a -m "second"
echo "Only this file would stay in HEAD without the conflict" > third
git add third
git stash pop
git status
2016年6月27日:增加了一个新的文件在示例中称为“第三”,以显示像scy这样的解决方案的解决方法仅适用于空HEAD,但不能修复HEAD没有像git stash pop
那样的内容而没有冲突的初始问题。
因此,你git add你已解决的冲突文件,有效地在索引中登台,并且你不希望他们在我们的索引? – Romain
是的,这是正确的。我只想当'git stash pop'在没有冲突发生时(但通知哪些文件需要合并)的行为。 – Sven
看起来像这样的答案在这里:http://stackoverflow.com/questions/3945826/git-stash-questions。在选择的答案中,Adam在第4条评论中解释了为什么git会这样做。 – Patrick