Skip to content

Instantly share code, notes, and snippets.

@apas
Last active November 6, 2016 04:31
Show Gist options
  • Save apas/f0fd9cede5da742c47572700bdc01ac6 to your computer and use it in GitHub Desktop.
Save apas/f0fd9cede5da742c47572700bdc01ac6 to your computer and use it in GitHub Desktop.
minimal and elegant git aware shell prompt
# download jimeh's git-aware-prompt
# https://github.com/jimeh/git-aware-prompt
export GITAWAREPROMPT=~/.gap/git-aware-prompt
source $GITAWAREPROMPT/main.sh
# change your PS1 accordingly
# that'd normally print: `~ $`
# and in a git repo w/o changes: `/path/to/repo(branch-name) $`
# in git w/ changes: `/path/to/repo(branch-name)* $`
# (the asterisk is in red)
export PS1="\[\e[36;1m\]\w\[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\] \$ "
@apas
Copy link
Author

apas commented Nov 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment