diff --git a/README.md b/README.md index 003dd7c..480441d 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,9 @@ this article: [How to: Change / Setup bash custom prompt (PS1)][how-to] [how-to]: http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html +If you don't want untracked files to be included in the "dirty" decision process, +set the variable `GIT_PROMPT_IGNORE_UNTRACKED` to any value. + ### Suggested Prompts diff --git a/prompt.sh b/prompt.sh index 6a737b8..de15137 100644 --- a/prompt.sh +++ b/prompt.sh @@ -12,7 +12,7 @@ find_git_branch() { } find_git_dirty() { - local status=$(git status --porcelain 2> /dev/null) + local status=$(git status --porcelain ${GIT_PROMPT_IGNORE_UNTRACKED:+--untracked-files=no} 2> /dev/null) if [[ "$status" != "" ]]; then git_dirty='*' else