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:
This should do the trick git ls-remote REMOTE | awk "/BRANCH/ {print \$1}"
git ls-remote REMOTE | awk "/BRANCH/ {print \$1}"
Replace REMOTE with the name of the remote repository and BRANCH with the name of the branch.