memical
memical

Reputation: 2493

how to check that all changes were taken after a git merge

in our git workflow we use branches (pretty much as described here a successful git branching model)

so when we merge one branch into the other we use:

git checkout <destination>
git merge --no-ff <src>

if there is a conflict, after resolving it, i would like to check if the merge was correct (if nothing was overwritten in destination and if all the changes were taken from source).

to check if nothing was overwritten in destination i run a diff between the commit before the merge and the commit with the merge resolution.

but how can i check that everything was taken from master and has not been lost in the merge/resolution?

thanks.

Upvotes: 1

Views: 239

Answers (2)

g19fanatic
g19fanatic

Reputation: 10921

you can view a diff of the resulting merge with the previous commit in the merged branch

git diff HEAD^

this command will show the difference in all files between your current state (which in your case should be the merge) and the previous commit in this branch

Upvotes: 1

AnoE
AnoE

Reputation: 8345

Well, you can be certain that everything that is not a conflict has been "taken" successfully. And with conflicts, you have to resolve them manually anyways, so git cannot help you there.

If you are frequently unsure of what happens during a conflicht, git help merge has an option for you:

   An alternative style can be used by setting the "merge.conflictstyle" configuration variable to "diff3". In "diff3"
   style, the above conflict may look like this:

Setting this option makes it so you not only see your and their side, but also the original text of the conflicting lines. That should remove all guesswork.

Upvotes: 1

Related Questions