cat .git/HEAD | cut -c17-9999 Useful if you are in docker and dont want to install git in your container :)