Skip to content

Instantly share code, notes, and snippets.

@gak
Last active December 23, 2015 07:29
Show Gist options
  • Save gak/6601586 to your computer and use it in GitHub Desktop.
Save gak/6601586 to your computer and use it in GitHub Desktop.
function git_branch
set -g git_branch (git rev-parse --abbrev-ref HEAD ^ /dev/null)
if [ $status -ne 0 ]
set -ge git_branch
set -g git_dirty_count 0
else
set -g git_dirty_count (git status --porcelain | wc -l | sed "s/ //g")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment