If you mean the last commit you pushed to the master
branch then, assuming your remote is origin
:
git rev-parse origin/master
This will show you the commit ID of the tip of the master
branch of the origin
origin, as your local repository is currently aware. This may mean that the commit is someone else's commit, if someone else pushed commits after you did and you have since fetch
ed that branch.
git show -p origin/master
This command will give you information about the commit, including the commit ID, author, log message, and diff to its parent commit(s).
One of my favorite Git commands for doing exactly this kind of inspection:
git log --pretty=oneline --abbrev-commit --graph --decorate --all
This will display a nice ASCII-art graph of the commit history, and each commit will show any refs that are targeting it. This way you can, at a single glance, see branches and merges in history and easily see where origin/master
is in relation to your own master
.