使用工作目录中的合并冲突和其他文件撤消Git Stash Pop

时间:2015-03-13 20:11:22

标签: git git-merge git-stash

假设我执行以下命令与git stash pop创建合并冲突:

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 "3" > three;
git add -A;
echo "4" > four;
git stash pop; 
git status

给了我:

On branch develop
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    modified:   one
    new file:   three

Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add <file>..." to mark resolution)

    both modified:   two

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    four

在这种情况下,文件三和四与存储弹出文件无关,并且正在进行中。如果我有很多正在进行的文件,则很难通过并尝试找出存储受影响的内容,并单独重置文件或解决冲突。

我已经搜索了所有的搜索结果,但我找不到一个好方法来删除隐藏弹出窗口的效果。我不能只是做git reset HEAD。取消暂存文件。我试图从存储中创建一个补丁并反向应用它,但它不起作用,因为文件二看起来像这样:

<<<<<<< Updated upstream
2.2
=======
2.1
>>>>>>> Stashed changes

使用此文件应该有一种方法可以保持上游更改并删除隐藏的更改吗?

我是否必须将其解决并解决合并冲突?还是有办法在存储弹出之前分离工作目录中的内容?

0 个答案:

没有答案