mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Add global gitignore to git-ignore output
This commit is contained in:
parent
6459db39aa
commit
aa084d9b7b
|
|
@ -2,9 +2,14 @@
|
|||
|
||||
if test $# -eq 0; then
|
||||
test -f .gitignore && cat .gitignore
|
||||
if test -f `git config --global core.excludesfile`; then
|
||||
echo -e "\n# Global gitignore:\n"
|
||||
cat `git config --global core.excludesfile`
|
||||
fi
|
||||
else
|
||||
for pattern in $@; do
|
||||
echo "... adding '$pattern' to .gitignore"
|
||||
(test -f .gitignore && grep -q $pattern .gitignore) || echo $pattern >> .gitignore
|
||||
done
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue