git.zsh 403 B

1234567891011121314151617
  1. # get the name of the branch we are on
  2. function git_prompt_info() {
  3. ref=$(git symbolic-ref HEAD 2> /dev/null) || return
  4. branch=${ref#refs/heads/}
  5. if [[ -d .git ]]; then
  6. CURRENT_BRANCH="(${branch})"
  7. else
  8. CURRENT_BRANCH=''
  9. fi
  10. echo $CURRENT_BRANCH
  11. }
  12. parse_git_dirty () {
  13. [[ $(git status | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "%{$fg[white] ♻ "
  14. }