gpt4 book ai didi

Git diff 在 git stash pop 之后不起作用

转载 作者:太空狗 更新时间:2023-10-29 14:27:22 24 4
gpt4 key购买 nike

git stash pop 之后,有一些冲突,比如:

<<<<<<< Updated upstream
int foo = 5;
=======
int foo = 6;
>>>>>>> Stashed changes

我在代码中解决了它们,但现在我无法在提交之前预览我的更改。我得到的就是这个,我知道有变化:

diff --cc mainwindow.cpp
index 24dc025,2c44ad8..0000000
--- a/mainwindow.cpp
+++ b/mainwindow.cpp

我如何强制 git diff 将我的当前源与上次提交进行比较?

最佳答案

您的pop 导致 merge 冲突。为了解决它,您需要编辑文件(您已经这样做了),然后调用 git add mainwindow.cpp 告诉 git,您已经解决了冲突。

如果您想预览更改,可以使用 git diff --cached 进行。这是因为 git add 已经将您的更改添加到索引中。

关于Git diff 在 git stash pop 之后不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16476476/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com