-
-
Save fpedroza/cf45176b363cc4ee0c16d257bb93d732 to your computer and use it in GitHub Desktop.
A script to manage a .gitignore file
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/bash | |
# To add two items to the current .gitignore file: | |
# gitignore '*.swp' bin | |
# | |
# To sort and de-dupe the current .gitignore file: | |
# gitignore | |
GITIGNORE=.gitignore; | |
# create ignore file if necessary | |
if [ ! -f $GITIGNORE ] ; then | |
touch $GITIGNORE; | |
echo "$GITIGNORE created" | |
fi | |
# Append each argument to its own line: | |
for item in "$@"; do | |
echo "$item" >> $GITIGNORE; | |
done | |
# Remove duplicates (and sort): | |
sort -u $GITIGNORE -o $GITIGNORE |
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
# template/example global gitignore | |
*~ | |
.DS_Store | |
# context tunnel configs are specific to my machine | |
#src/main/webapp/META-INF/context.*-tunnel.xml | |
app.properties | |
#-------- idea --------- | |
.idea/ | |
*.iml | |
#-------- java --------- | |
#*.class | |
# Package Files # | |
#*.jar | |
#*.war | |
#*.ear | |
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | |
hs_err_pid* | |
#------- maven --------- | |
target/ | |
#------- node ---------- | |
# Logs | |
#logs | |
*.log | |
appconfig.js | |
config.override | |
package-lock.json | |
# Runtime data | |
#pids | |
#*.pid | |
#*.seed | |
# Directory for instrumented libs generated by jscoverage/JSCover | |
#lib-cov | |
# Coverage directory used by tools like istanbul | |
#coverage | |
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | |
#.grunt | |
# node-waf configuration | |
#.lock-wscript | |
# Compiled binary addons (http://nodejs.org/api/addons.html) | |
#build/Release | |
# Dependency directory | |
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git | |
node_modules | |
bower_components |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment