Git Hash value of last un-pushed local commit

196 Views Asked by At

I have 3 local commits on my branch mainline which are ahead of the remote repo. How to get the hash value of the earliest local commit?

Example:

A <- HEAD(mainline) local
B
C
D <- origin/mainline synced with remote

How to get hash value of commit C?

1

There are 1 best solutions below

2
On BEST ANSWER

git log --pretty=%H origin/master..HEAD |tail -n1