Skip to content

Instantly share code, notes, and snippets.

@adhocore
Created May 15, 2019 04:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adhocore/b0ac7ac99389d7e0a3344b5af8ad42e6 to your computer and use it in GitHub Desktop.
Save adhocore/b0ac7ac99389d7e0a3344b5af8ad42e6 to your computer and use it in GitHub Desktop.
Get current git branch without using `git` command
cat .git/HEAD | cut -c17-9999

Useful if you are in docker and dont want to install git in your container :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment