dotfiles/zsh/modules/git/functions/git-ignore-add

11 lines
249 B
Plaintext
Raw Normal View History

2018-04-05 13:06:54 +02:00
# make sure we have a git-root
if ! git-root &> /dev/null; then
print 'not in a git repository' >&2
return 1
fi
# we are in a git repository. add parameters to .gitignore
for file in "${@}"; do
print "${file}" >>! $(git-root)/.gitignore
done