From b4f4dd1197c69385cebf5bb1e9943a05cd7fe7ee Mon Sep 17 00:00:00 2001 From: Jan Schulz Date: Thu, 22 Oct 2015 10:35:24 +0200 Subject: [PATCH] Add more info how to set global gitignore --- bin/git-ignore | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/git-ignore b/bin/git-ignore index f710bedd7..85bd5e417 100755 --- a/bin/git-ignore +++ b/bin/git-ignore @@ -14,7 +14,15 @@ function show_global { } function add_global { - add_patterns `git config --global core.excludesfile` "$@" + local global_gitignore=$(git config --global core.excludesfile) + if [ -z "$global_gitignore" ]; then + echo "Can't find global .gitignore." + echo "" + echo "Use 'git config --global --add core.excludesfile ~/.gitignore-global' to set the path to your global gitignore file to '~/.gitignore-global'." + echo "" + else + add_patterns `git config --global core.excludesfile` "$@" + fi } function show_local {