Last active
December 15, 2015 17:59
-
-
Save mortymacs/5300114 to your computer and use it in GitHub Desktop.
Showing branch and commits number of current directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function gb | |
| { | |
| if [ -d ".git" ] | |
| then | |
| cc=$(git log --pretty=oneline|wc -l) | |
| gb=$(git branch | grep '*' | awk '{print $2}') | |
| echo [$gb:$cc] | |
| fi | |
| } | |
| ## then add to your command line | |
| #PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w[\t]$(gb) $ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment