Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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.

like image 975
Mohammed H Avatar asked Jan 04 '13 09:01

Mohammed H


People also ask

What do I do if my branch is ahead of origin master?

This message from git means that you have made three commits in your local repo, and have not published them to the master repository. The command to run for that is git push {local branch name} {remote branch name} .

How do you find all the commits made on a branch?

On GitHub.com, you can access your project history by selecting the commit button from the code tab on your project. Locally, you can use git log . The git log command enables you to display a list of all of the commits on your current branch. By default, the git log command presents a lot of information all at once.

How do I see commits in master branch?

To confirm, you can run git branch . The branch that you are on will be the one with a * next to it. Git checkout might fail with an error message, e.g. if it would overwrite modified files. Git branch should show you the current branch and git log master allows you to view commit logs without changing the branch.

How can I see Unpushed commits?

We can view the unpushed git commits using the git command. It will display all the commits that are made locally but not pushed to the remote git repository.


1 Answers

The command

git log origin/master..master 

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

like image 117
tobiasbayer Avatar answered Oct 22 '22 16:10

tobiasbayer