美文网首页
Ubuntu 终端git配置

Ubuntu 终端git配置

作者: Sivin | 来源:发表于2019-08-08 12:32 被阅读0次
function git_branch {
    branch="`git branch 2>/dev/null | grep "^\*" | sed -e "s/^\*\ //"`"
        if [ "${branch}" != "" ];then
            if [ "${branch}" = "(no branch)" ];then
                branch="(`git rev-parse --short HEAD`...)"
            fi
            echo "($branch)"
        fi
} 
export PS1='\u@\h \[\033[01;36m\]\W\[\033[01;32m\]$(git_branch)\[\033[00m\]\n\$'

相关文章

网友评论

      本文标题:Ubuntu 终端git配置

      本文链接:https://www.haomeiwen.com/subject/idxxjctx.html