Your branch is ahead of 'origin/master' by X commits. How to find the X commits?

Mohammed H picture Mohammed H · Jan 4, 2013 · Viewed 13.1k times · Source

I was checking the X commits using the following command:

git log --author=<my-name> -<X>

But the problem is that I accidentally pulled code from another repository and added the commits from the repository to my local git repository.

So I cannot use the above command since the new commits contains some other authors.

Answer

tobiasbayer picture tobiasbayer · Jan 4, 2013

The command

git log origin/master..master

shows the commits that are on master but not on origin/master.