Skip to content

Instantly share code, notes, and snippets.

@tg123
Created April 15, 2014 04:20
Show Gist options
  • Save tg123/10701869 to your computer and use it in GitHub Desktop.
Save tg123/10701869 to your computer and use it in GitHub Desktop.
pull content from github/gitignore into .gitignore by type
#!/bin/bash
t=$1
if [ -z "$t" ];then
echo "usage: $0 ignoretype"
echo "example: $0 Java"
exit 1
fi
URL="https://raw.githubusercontent.com/github/gitignore/master"
content=`curl "$URL/$t.gitignore" 2>/dev/null`
if [ -z "$content" ];then
echo "No $t on $URL"
exit 2
fi
echo "$content" >> .gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment