Dean Hiller
Dean Hiller

Reputation: 20182

how to view changed files on git branch and difference

I was trying to do this which didn't show anything different How to get the changes on a branch in git

I did a branch from master and since then changes have been made on master and my branch (called performance). All I want is

  1. The list of files changed/touched since branching "performance" branch (all files were committed)
  2. Show the complete difference of all those files changed/touched.

When doing git diff origin/master, it lists all changes on both branches :(.

What is the command since git diff HEAD..performance shows nothing(and ... also shows nothing)? Also, using log in the same way with .. and with ... also shows nothing.

If I do git log, I do see the commit I made on the performance branch with my comment about performance as well.

thanks, Dean

Upvotes: 1

Views: 401

Answers (1)

Dietrich Epp
Dietrich Epp

Reputation: 213258

First, find the branch point. You can do this with the merge-base command:

$ git merge-base performance master
cafebabe01234567...

Note: If you don't remember the merge-base command, you can always use gitx/gitk/gitg/etc. to find the branch point visually.

Then, you can do a diff from the branch point to the tip of the performance branch:

$ git diff cafebabe01234567... performance

Or, in a single line,

$ git diff $(git merge-base performance master) performance

Remember that git diff takes options, if you want to change how it displays the differences. See the man page.

Upvotes: 2

Related Questions