Victoria's Neofeed
  • 2019-07-22 16:28:43 -0400 -0400
    Victoria Drake

    Victoria Drake

    Jul 22, 2019

    Add the current git branch to your bash prompt! In .bashrc:

    parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
    }
    if [ "$color_prompt" = yes ]; then
        PS1='${debian_chroot:+($debian_chroot)}\[\033[0;1;38;5;247m\]> \[\033[3;38;5;68m\]\W $(parse_git_branch)\[\033[00m\] '
    else
        PS1='${debian_chroot:+($debian_chroot)}\W $(parse_git_branch)\[\033[00m\] '
    fi
    

    No more accidentally merging master into your this-seems-like-a-good-idea branch!

    2019-07-22 16:28:43 -0400 -0400 1847 days ago
    webmention this