Skip to content

Instantly share code, notes, and snippets.

@MarcoSero
Created November 3, 2015 21:51
Show Gist options
  • Save MarcoSero/fa11249d9215fe35b655 to your computer and use it in GitHub Desktop.
Save MarcoSero/fa11249d9215fe35b655 to your computer and use it in GitHub Desktop.
Fast git prompt
# Load oh-my-zsh first
source $ZSH/oh-my-zsh.sh
# If we are on a big repo, re-define git prompt
function git_prompt_info() {
if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}
function git_prompt_status() {
echo ''
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment