lost
lost

Reputation: 2391

How to see what git merge has done before commit?

Say you've done a merge:

git checkout mybranch
git merge master

then edited some files manually to deal with merge conflits.

git status will show all the files which have been modified, but git diff only appears to show changes in the files you've edited for merge conflicts. How can you see the changes relative to mybranch which the merge has introduced, before you commit the whole lot (after which I think you can just do git diff HEAD^ HEAD).

Coming from a mercurial background here so I am probably missing some concepts ...

Upvotes: 3

Views: 121

Answers (1)

D. Ben Knoble
D. Ben Knoble

Reputation: 4663

The usual way to see diffs of staged files is

git diff --cached

It should work here as well

Upvotes: 3

Related Questions