Skip to content

Commit fa1189b

Browse files
committed
Added possibility to ignore a repository completely by adding "GIT_PROMPT_IGNORE=1" to .bash-git-rc
Fixes #80
1 parent 9005bf4 commit fa1189b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # displays as ✘-1 fo
166166
on a per repository basis by creating a file named ``.bash-git-rc`` with the
167167
content ``FETCH_REMOTE_STATUS=0`` in the root of your git repository.
168168

169+
- You can also ignore a repository completely by creating a file named ``.bash-git-rc`` with the
170+
content ``GIT_PROMPT_IGNORE=1`` in the root of your git repository.
171+
169172
- You can get help on the git prompt with the function ``git_prompt_help``.
170173
Examples are available with ``git_prompt_examples``.
171174
A list of all available named colors is available with `git_prompt_color_samples`

gitprompt.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,18 @@ function setGitPrompt() {
200200
FETCH_REMOTE_STATUS=0
201201
fi
202202

203+
unset GIT_PROMPT_IGNORE
204+
203205
if [[ -e "$repo/.bash-git-rc" ]]; then
204206
source "$repo/.bash-git-rc"
205207
fi
206208

207-
if [ "$FETCH_REMOTE_STATUS" = 1 ]; then
209+
if [[ "$GIT_PROMPT_IGNORE" = 1 ]]; then
210+
PS1="$EMPTY_PROMPT"
211+
return
212+
fi
213+
214+
if [[ "$FETCH_REMOTE_STATUS" = 1 ]]; then
208215
checkUpstream
209216
fi
210217

0 commit comments

Comments
 (0)