1

I entered my office this morning, went to my local git repo and typed

git status

# On branch master
# Your branch is ahead of 'origin/master' by 2 commits. 
#
nothing to commit (working directory clean)

From this, I can see that I'm ahead of the origin branch. But is there a command I can use to find out exactly which file(s) or which parts of the files have differed?

Kian
  • 3,189
  • 3
  • 18
  • 16
  • 1
    Looks like this question has already been answered here : http://stackoverflow.com/questions/2016901/viewing-unpushed-git-commits – CrumbleZ Nov 10 '15 at 09:23

1 Answers1

1

You list the differences to the origin/master branch by executing:

git diff origin/master
Michael Mairegger
  • 6,833
  • 28
  • 41
  • Don't you need to fetch the origin before: git fetch origin ? – Renaud Kern Nov 10 '15 at 09:26
  • Yes, but if you didn’t fetch the remote before, Git won’t be able to tell you that your branch is ahead of the remote branch. – poke Nov 10 '15 at 09:26
  • @RenaudKern Yes and no. As `poke` mentioned: it would not be able to tell you that that your branch is ahead. On the other hand it might be that the master branch has new commits, therefore you are 2 commits ahead but X-commits behind. – Michael Mairegger Nov 10 '15 at 09:29