Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see what git merge has done before commit?

Tags:

git

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 ...

like image 264
lost Avatar asked Jan 27 '26 02:01

lost


1 Answers

The usual way to see diffs of staged files is

git diff --cached

It should work here as well

like image 119
D. Ben Knoble Avatar answered Jan 28 '26 18:01

D. Ben Knoble