Created
August 20, 2012 18:21
-
-
Save marshally/3406413 to your computer and use it in GitHub Desktop.
Git prompt improvements for bash-it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Checks if there are commits ahead from remote | |
function git_prompt_ahead() { | |
if [[ -n $(git log origin/$(current_branch)...HEAD --right-only 2> /dev/null | grep '^commit') ]]; then | |
echo -e "$SCM_THEME_PROMPT_AHEAD" | |
fi | |
} | |
# Checks if there are commits available from remote | |
function git_prompt_behind() { | |
if [[ -n $(git log origin/$(current_branch)...HEAD --left-only 2> /dev/null | grep '^commit') ]]; then | |
echo -e "$SCM_THEME_PROMPT_BEHIND" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment