Does anyone know how to get the latest SHA of a given branch from outside a git repository?
If you are inside a git repository, you can do:
As mentioned in comments above this should be the best solution:
$ git ls-remote | head -1 | cut -f 1