-
-
Save nightsparc/6752c7c9b0aa2d04975f2138e1db75df to your computer and use it in GitHub Desktop.
A script to manage a .gitignore file
This file contains 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/bash | |
# To add two items to the current .gitignore file: | |
# gitignore '*.swp' bin | |
# | |
# To sort and de-dupe the current .gitignore file: | |
# gitignore | |
# Append each argument to its own line: | |
for item in "$@"; do | |
echo "$item" >> .gitignore; | |
done | |
# Remove duplicates (and sort): | |
sort -u .gitignore -o .gitignore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment