Skip to content

terminal shows git branch

Haojian Wu edited this page Aug 11, 2013 · 1 revision

修改~./bashrc文件:

// xfce4 termial 自定义termial的输出内容和形式
PS1="( $TXTGRN\u$TXTRST )-( $TXTCYN\w$TXTRST )-\$parse_git_branch\n> "

function parse_git_branch () {
       git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}

Tech-Notes

LLVM/Clang

C/C++

Linux

Vim

Tools

Others

Chromium-Dev tips

Clone this wiki locally