Reputation: 48108
How can the SHA1 for the tip of origin be accessed?
For example the local branch may be behind from not being current when git pull
runs, or it may not even be checked out.
To give some context, I'm looking to print a log of commits that doesn't depend on the state of my local branches.
Upvotes: 0
Views: 305
Reputation: 9234
If you're looking at a branch off the origin called <branch>
, then you could use git rev-parse origin/<branch>
to get you the sha for the head of the branch.
Upvotes: 2