Suppose I checkout an older commit, with commit sha/id: commit_34 of branch branch_a of repository repo_b, with:
git checkout commit_34
Then, the old commit sha (which is the commit sha of the new head) can be retrieved with:
git rev-parse HEAD
which returns:
commit_34
Once in this commit (with sha commit_34), without checking out another commit, how could I get the latest (in absolute sense e.g. commit_36) commit sha in that branch branch_a?
Example
Suppose the commit sha's in branch branch_a are, from latest on top, to oldest on bottom:
commit_36
asdlasdfalsdfhlaksdhflkajsdfhalskdjfh3243
commit_34
asdlasdfalsdfhlakssdfsdf1sdfhalskdjfh3243
asdfljahslvkhasdljfkh324klj2h34lkj234hh3j
...
Assumption
I (currently) do not know what the current branch is. I will look into how I can retrieve that. Such that I can apply the answers given in this post.