Viewing unpushed Git commits

Viewing unpushed Git commits

How can I view any local commits I’ve made, that haven’t yet been pushed to the remote repository? Occasionally, git status will print out that my branch is X commits ahead of origin/master, but not always.

You can also view the diff using the same syntax

If you want to see all commits on all branches that aren’t pushed yet, you might be looking for something like this:

And if you only want to see the most recent commit on each branch, and the branch names, this:

You can show all commits that you have locally but not upstream with

@{u} or @{upstream} means the upstream branch of the current branch (see git rev-parse --help or git help revisions for details).

This worked for me:

As indicated at Git: See all unpushed commits or commits that are not in another branch.

You can do this with git log:

Assuming that origin is the name of your upstream, leaving off any revision name after .. implies HEAD, which lists the new commits that haven’t been pushed.

Lascia un commento

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.

Chiudi il menu