Git diff不';在git stash pop之后我就不工作了
在git stash pop之后,出现了一些冲突,比如:Git diff不';在git stash pop之后我就不工作了,git,qt-creator,git-stash,Git,Qt Creator,Git Stash,在git stash pop之后,出现了一些冲突,比如: <<<<<<< Updated upstream int foo = 5; ======= int foo = 6; >>>>>>> Stashed changes 如何强制git diff将当前源代码与上次提交的源代码进行比较?您的pop导致合并冲突。为了解决它,您需要编辑文件(您已经编辑了),然后调用git add main window.cpp告诉
<<<<<<< Updated upstream
int foo = 5;
=======
int foo = 6;
>>>>>>> Stashed changes
如何强制git diff将当前源代码与上次提交的源代码进行比较?您的
pop
导致合并冲突。为了解决它,您需要编辑文件(您已经编辑了),然后调用git add main window.cpp
告诉git您已经解决了冲突
如果要预览更改,可以使用
git diff--cached
。这是因为git add
已经将您的更改添加到了索引中。它只给出了*未合并的路径mainwindow.cpp
。git status--short
的输出是什么?它给出了UU mainwindow.cpp
。奇怪的是,如果现在执行:git stash
,那么git stash pop
a传统的git-diff现在将按预期工作。也许我错误地认为git stash pop
实际上是git stash
的反函数,使您回到相同的状态。这里的情况并非如此。
diff --cc mainwindow.cpp
index 24dc025,2c44ad8..0000000
--- a/mainwindow.cpp
+++ b/mainwindow.cpp