3

When we do typical merges (ie: from branch A to B) with conflicts I can see the differences by running:

git status git difftool --dir-diff --cached 

But if there are no conflicts then these commands don't return any results. We run git push to push the changes to the remote repo (branch B in this example).

What command can you run to see the differences which you just pulled down (and pushed) in this case?

2 Answers 2

2

Maybe the git diff command will show what you want.

Sign up to request clarification or add additional context in comments.

3 Comments

git diff does the same thing as git difftool (what I'm trying). Doesn't return any results.
Huuum, in this case you can use the git log command, find the hash code for the merge commit, and then use git diff <hash code> Example
That works: git log -n 1 shows the merge commit and git diff xxx~1 lists the differences.
1

Git diff is "helping" you by telling you that the merge introduced no new changes. All the changes from the merge are accounted for by the changes in its parents. You can see the individual changes that went into the merge by specifically comparing the merge with one or the other parent, e.g.,

git diff <merge-commit> <merge-commit>^1 # diff against 1st parent git diff <merge-commit> <merge-commit>^2 # diff against 2nd parent 

And so on if you have an octopus merge. These will show you the individual changes that each parent brought into the merge.

If the merge commit in question is your current head, then you can

git diff HEAD^1 git diff HEAD^2 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.