Last active
December 31, 2015 13:39
-
-
Save codegefluester/7994331 to your computer and use it in GitHub Desktop.
Fetches a gitignore template from Github and adds it to the repo.
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
| #!/bin/sh | |
| # Example: git-ignore.sh Objective-C | |
| template=$1 | |
| currentDir=`pwd` | |
| if [ $template ] | |
| then | |
| echo "Fetching https://raw.github.com/github/gitignore/master/$template.gitignore" | |
| curl https://raw.github.com/github/gitignore/master/$template.gitignore -o "$currentDir/.gitignore" | |
| cd "$currentDir" | |
| git add .gitignore | |
| git commit -m "Updated .gitignore" | |
| else | |
| echo "Missing template name, see https://github.com/github/gitignore for a list of available templates" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment