Skip to content

Instantly share code, notes, and snippets.

@ihower
Last active November 7, 2016 06:20
Show Gist options
  • Save ihower/dec41671245eceff56d1 to your computer and use it in GitHub Desktop.
Save ihower/dec41671245eceff56d1 to your computer and use it in GitHub Desktop.
.bash_profile
alias stree='/Applications/SourceTree.app/Contents/Resources/stree'
alias subl="'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'"
function parse_git_dirty {
if [[ $(git status 2> /dev/null | tail -n1) == "nothing to commit, working directory clean" ]]; then
echo "✔ "
else
echo "✘ "
fi
}
function git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return;
echo "("$(parse_git_dirty)${ref#refs/heads/}") ";
}
PATH=$HOME/bin:/usr/local/bin:$PATH
PS1="[\[\033[1;32m\]\w\[\033[0m\]] \[\033[0m\]\[\033[1;36m\]\$(git_branch)\[\033[0;33m\]\\[\033[0m\]♨ "
@HEROGWP
Copy link

HEROGWP commented Sep 9, 2016

git 版本2.10以上
nothing to commit, working directory clean
改成
nothing to commit, working tree clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment