Created
February 19, 2019 09:13
-
-
Save ivanbogomoloff/ec08cf613a7a08f1c095897a67552ada to your computer and use it in GitHub Desktop.
Append to PS1 info about current version control system and branch name
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
# .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