Question

Using Eclipse (EGit) how do I see/review commits that haven't been pushed to origin yet?

This is what the history looks like:

EGit History view

Was it helpful?

Solution

You can see whether you have unpushed commits by the arrow and number in the decoration of the project in the explorer view or the Git Repositories view. You can see it here:

enter image description here

In the picture above, the http-request repository has 2 unpushed commits.

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.

Let's look at the screenshot from your question:

EGit History view

This is how to read the history: Start at the commit labeled master, which is the topmost one. Then follow the orange line downwards until you arrive at the next commit, which is the third one labeled origin/master. So you locally have one more commit, which is shown in the project decorations as an upwards-pointing arrow with the number 1 besides it.

You may be confused by the second commit in the screenshot, labeled ORIG_HEAD. When you look at the lines you will see that it is not included between master and origin/master, but is parallel to master. ORIG_HEAD is a backup copy of your HEAD before you did a "dangerous" operation such as reset. You can use it to undo a reset for example.

If you don't want to see ORIG_HEAD in the history, open the view menu (that little triangle) and deselect Show > Additional Refs, see the manual.

OTHER TIPS

Go to Window->Show View->Other->GIT->Git Reflog

There you'll see the commits that both have been pushed and those that aren't pushed, but wont differentiate between them.

Better is to use the Egit equivalent of Gitk:

Right click on the Project choose Team->Show in history. For each commit you'll se which branches that commit is available on. If it only says <tree-name> and not origin/<tree-name> it means that it isn't pushed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top