Related: List Git commits not pushed to the origin yet
git rev-parse HEAD gives me the latest commit in the workspace, but this can be a locally committed githash. In other words, a commit which is not pushed to remote yet
how do I find the latest commit which also exists in remote in the workspace
To get the latest commit on the currently checked out branch's configured remote branch, do
(Note :
@{upstream} / @{u}are not placeholders, they're meant to be typed as is)From the doc :