Skip to content

Instantly share code, notes, and snippets.

@rodrigoreis
Last active July 9, 2022 15:14
Show Gist options
  • Select an option

  • Save rodrigoreis/7dd796d05d6682e995692be514830f3a to your computer and use it in GitHub Desktop.

Select an option

Save rodrigoreis/7dd796d05d6682e995692be514830f3a to your computer and use it in GitHub Desktop.
function __git_ps1_dirty() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
function changes_in_branch() {
echo -ne "\033[0;35m$(__git_ps1_dirty)\033[0m";
}
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(changes_in_branch)\$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment