Last Updated: February 25, 2016
·
1.139K
· sgtpooki

Git alias to easily create .gitignore file with gitignore.io

Add this to your git config file (edit your global config with git config -e --global) to easily add a .gitignore file to your project from gitignore.io:

ignores = !sh -c \"wget --no-check-certificate https://www.gitignore.io/api/$1 -O .gitignore\"

NOTE: Mac/Linux users may need to fidget with the syntax a bit (I'm on windows, using msysgit)

git ignores "phpstorm,javascript,somethingelse,whatever,blah,blah"

you wget will create a gitignore file for you that includes the commonly ignored files as per gitignore.io

NOTE 2: this command does overwrite any existing .gitignore file. You could change the command to append if you like, or create a slightly different command that appends if you want