mattalxndr
mattalxndr

Reputation: 9418

Retrieving an up to date remote branch commit hash without fetching

Is there a command (something like git remote show maybe) that will get me an up to date remote branch commit hash without updating references by fetching?

Upvotes: 1

Views: 63

Answers (2)

Thomas
Thomas

Reputation: 2137

You can use

git ls-remote <URL> <BRANCH>

and you will get following output:

λ git ls-remote https://github.com/rogerwang/node-webkit.git master
b5d2137d95d861ede02188dcbc7cdc459562d706        refs/heads/master

see help page: https://www.kernel.org/pub/software/scm/git/docs/git-ls-remote.html

Upvotes: 2

rangalo
rangalo

Reputation: 5606

Try

git log origin/<branch> -1

Upvotes: -1

Related Questions