`git branch` also determines whether your working tree is modified. This can be extremely slow on large repos.<p>`git rev-parse --abbrev-ref HEAD` is very inexpensive in comparison, and doesn&#x27;t print anything extra you might need to parse out if you&#x27;re in a shell script.