Skip to content

Instantly share code, notes, and snippets.

@kungfoo
Last active December 11, 2015 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kungfoo/4672056 to your computer and use it in GitHub Desktop.
Save kungfoo/4672056 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
status = `git status -sbz 2> /dev/null`
ahead = (status.match /ahead (\d+)/)
behind = (status.match /behind (\d+)/)
print "[" if ahead || behind
print "↑#{ahead[1]}" if ahead
print "↓#{behind[1]}" if behind
print "]" if ahead || behind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment