Last active
May 11, 2021 14:19
-
-
Save martinec/d14bba04e223283fd932999a53d3357d to your computer and use it in GitHub Desktop.
.gitignore.local for gitignore.io
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global alias.ignore-create '!gi() { \ | |
if [ $# -eq 0 ]; then \ | |
echo "Usage: git ignore-create list-item,...\n" ;\ | |
echo "Avalaible list items:" ;\ | |
curl -sL "https://www.gitignore.io/api/list" | tr -d "\n" ;\ | |
echo "" ;\ | |
else \ | |
echo "# DO NOT EDIT THIS FILE" ;\ | |
echo "# Put your local changes on .gitignore.local, then\n" ;\ | |
echo "# To update type: git ignore-update" ;\ | |
echo "# To recreate type: git ignore-create $@\n" ;\ | |
echo "# You only need to install this script once" ;\ | |
echo "# curl -L https://git.io/fjL9q | sh\n" ;\ | |
echo "# script source at https://git.io/fjL9k" > .gitignore ;\ | |
curl -sL "https://www.gitignore.io/api/$@" >> .gitignore ;\ | |
echo "\n\n### LOCAL CHANGES STARTS HERE ###" >> .gitignore ;\ | |
touch .gitignore.local ; cat .gitignore.local >> .gitignore ;\ | |
cat .gitignore ;\ | |
git config --global alias.ignore-update "!gi() { \ | |
git ignore-create $@ ;}; gi" ;\ | |
fi ;\ | |
}; gi' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git ignore-create
|git ignore-update
for gitignore.io preserving local changes.gitignore.local
to add any local change:.gitignore
to include the local changes, type: