diff --git a/README.md b/README.md index eb54d77d..756186c0 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,9 @@ GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # displays as ✘-1 fo on a per repository basis by creating a file named ``.bash-git-rc`` with the content ``FETCH_REMOTE_STATUS=0`` in the root of your git repository. +- You can also ignore a repository completely by creating a file named ``.bash-git-rc`` with the + content ``GIT_PROMPT_IGNORE=1`` in the root of your git repository. + - You can get help on the git prompt with the function ``git_prompt_help``. Examples are available with ``git_prompt_examples``. A list of all available named colors is available with `git_prompt_color_samples` diff --git a/gitprompt.sh b/gitprompt.sh index b5180559..cc71eef1 100755 --- a/gitprompt.sh +++ b/gitprompt.sh @@ -200,11 +200,18 @@ function setGitPrompt() { FETCH_REMOTE_STATUS=0 fi + unset GIT_PROMPT_IGNORE + if [[ -e "$repo/.bash-git-rc" ]]; then source "$repo/.bash-git-rc" fi - if [ "$FETCH_REMOTE_STATUS" = 1 ]; then + if [[ "$GIT_PROMPT_IGNORE" = 1 ]]; then + PS1="$EMPTY_PROMPT" + return + fi + + if [[ "$FETCH_REMOTE_STATUS" = 1 ]]; then checkUpstream fi