summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2021-08-22 11:06:26 +0200
committerxengineering <me@xengineering.eu>2021-08-22 11:06:26 +0200
commita09b15fb4cdf46657f46fa23e177b079053b8fb1 (patch)
treeaca0add4e87085bc770e67fb11e1009d38e6dbc5
parent9d381fbca3a72bfb80c3e7b7b924e2fa6a9c92d8 (diff)
downloaddotfiles-a09b15fb4cdf46657f46fa23e177b079053b8fb1.tar
dotfiles-a09b15fb4cdf46657f46fa23e177b079053b8fb1.tar.zst
dotfiles-a09b15fb4cdf46657f46fa23e177b079053b8fb1.zip
Add Git Branch to Prompt in .bashrc
-rw-r--r--.bashrc6
1 files changed, 5 insertions, 1 deletions
diff --git a/.bashrc b/.bashrc
index 11528f7..a456bd1 100644
--- a/.bashrc
+++ b/.bashrc
@@ -25,5 +25,9 @@ alias horizons='telnet horizons.jpl.nasa.gov 6775' # a NASA server providing da
GOPATH=$HOME/go
PATH=$PATH:~/bin
-PS1='[\u@\h \W]\$ '
+parse_git_branch() {
+ git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
+}
+
+PS1='[\u@\h$(parse_git_branch) \W]\$ '