Pergunta

After git stash pop, there were some conflicts, things like:

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

I resolved them in the code, but now I can't preview my changes before committing them. All I get is this, and I know there are changes:

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

How do I force git diff to compare my current source to the last commit?

Foi útil?

Solução

Your pop resulted in a merge conflict. In order to resolve it, you need to edit the file (which you already did) and then call git add mainwindow.cpp to tell git, that you have resolved the conflict.

If you want to preview your changes, you can do so with git diff --cached. This is because git add already added your changes to the index.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top