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?

1

1 Answer 1

1

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

git diff origin/master 
Sign up to request clarification or add additional context in comments.

3 Comments

Don't you need to fetch the origin before: git fetch origin ?
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.
@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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.