Getting the last commit hash from a remote repo without cloning

$ git ls-remote https://github.com/gturri/dokuJClient.git 
2fb540fc8c7e9116791638393370a2fa0f079737    HEAD
2fb540fc8c7e9116791638393370a2fa0f079737    refs/heads/master

This command can be run from any directory.

If you only want the last sha1, eg to use it in a script, you could then do:

git ls-remote https://github.com/gturri/dokuJClient.git HEAD | awk '{ print $1}'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)