Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I see my local unpushed commits? [duplicate]

Tags:

git

git-svn

If I have a local branch test and the remote branch is test. So if I did a push it would be push origin test:test

How can I see my local unpushed commits that I did on that branch? git log?

like image 534
user565660 Avatar asked May 01 '13 17:05

user565660


People also ask

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.

How do I see my local commit history?

The commit history can be viewed in different ways by using the `git log` command. A local repository named bash has been used in this tutorial to test the commands used in this tutorial. Run the following command to view the commit history of the repository.

How can I see local commits in Eclipse?

To review the changes before pushing, you can look at the History view. E.g. when you have unpushed commits on the master branch, you will see origin/master in the history pointing to the latest commit that is known on the remote repository. On top of that, you will see your local commits and the label for master.

How do I delete all local commits?

If your excess commits are only visible to you, you can just do git reset --hard origin/<branch_name> to move back to where the origin is. This will reset the state of the repository to the previous commit, and it will discard all local changes.


1 Answers

I generally use gitk --all for that (after a git fetch --all).

And, for console mode, I have an alias of git log --graph --all --decorate --oneline which gives a nice and compact overview of your branches. In particular, it shows what you can push.

For both these commands you can specify branches (test origin/test in your case) instead of showing them all with --all.

like image 67
François Avatar answered Oct 13 '22 00:10

François