Skip to content

Instantly share code, notes, and snippets.

@ivanbogomoloff
Created February 19, 2019 09:13
Show Gist options
  • Save ivanbogomoloff/ec08cf613a7a08f1c095897a67552ada to your computer and use it in GitHub Desktop.
Save ivanbogomoloff/ec08cf613a7a08f1c095897a67552ada to your computer and use it in GitHub Desktop.
Append to PS1 info about current version control system and branch name
# .bashrc
#
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
force_color_prompt=yes
gb() {
#git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(git:\1)/'
}
hgb() {
hg branch 2> /dev/null | awk '{b="(hg:"$1")"; print b;}'
}
export PS1="\[\033[1;37m\]\w(\D{%T})\[\033[33m\]\$(gb)\$(hgb)\[\033[00m\]$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment