Bash script for maintaining and standardizing .gitignore files using the program-specific files available at github/gitignore.
ignoretool <mode> <list> -w -k -f <file>
add
- add a new section to an existing .gitignore file.create
- initialize a new .gitignore file from a list of preset or selected sections.list
- list the sections found in a.gitignore
file.remove
- remove a particular section (or list of sections).update
- parse existing file and updating the sections present in the file.
The list is a comma- or space-delimited list of gitignore configurations. To see
what the names of each are, look at the data
file for reference.
If no list options are given, the script will open a fzf
prompt for you to
specify which ignore files to use.
The script will print to stdout
by default. To write to the gitignore file
itself, pass the -w
flag to the script.
Use -k
in conjunction with -w
to backup the existing .gitignore before
writing the new one. Should be unnecessary if the file is already versioned.
Use the -f
flag to specify the path to the .gitignore file.
If no file is specified, the script will use Git to find the base of the repository and search f the .gitignore file there.