Skip to content

Instantly share code, notes, and snippets.

@jsumners
Created September 25, 2024 11:03
Show Gist options
  • Save jsumners/e16a00cf27290c3bf0c6b8466a7bfa6c to your computer and use it in GitHub Desktop.
Save jsumners/e16a00cf27290c3bf0c6b8466a7bfa6c to your computer and use it in GitHub Desktop.
Simple Bash script to fetch GitHub maintained gitignore files
#!/usr/bin/env bash
TYPE=$1
if [ "${TYPE}" == "" ]; then
echo "Missing gitignore type name."
echo "See https://github.com/github/gitignore for available types."
echo "Example: git fetch-ignore Objective-C"
exit 1
fi
UPPER1=$(echo ${TYPE:0:1} | tr '[:lower:]' '[:upper:]')
TYPE="${UPPER1}${TYPE:1}"
curl -s https://raw.githubusercontent.com/github/gitignore/main/${TYPE}.gitignore >> .gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment