mirror of
https://github.com/tj/git-extras.git
synced 2026-09-13 08:56:19 -04:00
modify the behavior of git-ignore, now it will cd root to find .gitignore
This commit is contained in:
parent
67241a46a8
commit
0374044790
|
|
@ -1,7 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
function show_contents {
|
||||
test -f "$2" && echo "$1 gitignore: $2" && cat "$2"
|
||||
if [ -f "$2" ]; then
|
||||
echo "$1 gitignore: $2" && cat "$2"
|
||||
else
|
||||
echo "There is not $1 .gitignore yet"
|
||||
fi
|
||||
}
|
||||
|
||||
function show_global {
|
||||
|
|
@ -13,10 +17,12 @@ function add_global {
|
|||
}
|
||||
|
||||
function show_local {
|
||||
cd "$(git root)"
|
||||
show_contents Local .gitignore
|
||||
}
|
||||
|
||||
function add_local {
|
||||
cd "$(git root)"
|
||||
add_patterns .gitignore "$@"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue