ITeye博客

show git branch in your bash prompt

standalone · 2013-07-26 16:47 · 开源软件 · Markdown

export PS1='\u@\h\ \w$(parse_git_branch "(%s)")]\$\e[m'

function parse_git_branch { ref=$(git-symbolic-ref HEAD 2> /dev/null) || return echo "("${ref#refs/heads/}")" }

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。