Git compare file changes after merge

I just merged the changes from another branch to my branch and there is a problem for the application. How can I compare the changes of certain files before and after the merge? Thanks!

Ming
LVL 1
mybluegrassAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gelonidaCommented:
Not sure  I understand your question:

you wan to know which files lines of a merged verson came from the other branch(es)?



1.) Identify the commit id of the merge and the commit id of your parent version.
================================================================

1.a) by command line
-------------------------
Use:
git log  (or alternatively git log --graph to visualize the merge tree)
identify the commit, that performed the merge.

The first to lines will look something like
commit 3a12c325b1425ea260c6b4cb1f
Merge: 8732954 551673b

In this example either commit 8732954 or commit 551673b will be your most recent commit before the merge.
If in doubt use git log 8732954 or git log 551673b tio determine your past commit before merge.

In my example it was commit 8732954

1.b) with gitk
----------------

- start gitk and search for the commit id of the merge.
- click on it
- in the bottom left section of the gitk window you should see a list
of 'Parent:' commits.
In my case the red Parent commit was mine.

2.) list all affected filed
===================

Now you can use for example
git diff --numstat 551673b 3a12c325b1425ea260c6b4cb1f
to list all affected files.

and then to list only the diffs for a given fie
git diff 551673b 3a12c325b1425ea260c6b4cb1f filename


Hope this helps.

Please explain your question in more detail if I misunderstood it
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Version Control

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.