我在周末升级到10.9,我的bash提示显示有点古怪。我现在的.bash_profile里有这个
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
PS1="\n\[\e[1;34m\]\$(date +%H:%M) \[\e[1;36m\]\w\[\e[1;33m\] \$(parse_git_branch) \[\e[1;31m\]\$(rvm_version)\n\[\e[0;32m\]> \[\e[0m\]"
unset color_prompt force_color_prompt过去(在10.8中)产生的提示符如下所示:
07:45 ~/code/project_dir [git-branch] 1.9.3@project如果需要将更改提交到我的git分支,它将添加一个星号([git-branch*])。
但是,自从升级以来,总是将*列在分支之后。其他的一切似乎都正常运作。我怎么能让它表现得像以前那样?
我也更新了最新版本的git。
发布于 2013-11-25 19:22:08
Per @chepner,我转而通过自制的bash完成包使用git-prompt.sh。
发布于 2013-11-25 16:17:57
这似乎是对git版本的更改。当我在OSX10.9 (Git 1.8.3.4)中运行git status时,来自干净存储库的消息是
nothing to commit, working directory cleanhttps://stackoverflow.com/questions/20194920
复制相似问题