Skip to content

Instantly share code, notes, and snippets.

@damar-wicaksono
Forked from nicwolff/gist:2925803
Last active August 29, 2015 14:08
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 damar-wicaksono/7d8421968d1f8934f1b0 to your computer and use it in GitHub Desktop.
Save damar-wicaksono/7d8421968d1f8934f1b0 to your computer and use it in GitHub Desktop.
# in ~/bin/gitprompt.csh:
setenv GIT_BRANCH_CMD "sh -c 'git branch --no-color 2> /dev/null' | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'"
set prompt="%m:%~ `$GIT_BRANCH_CMD`\n%B%#%b "
# and then in ~/.cshrc:
alias precmd "source ~/bin/gitprompt.csh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment