getignore
Keep your .gitignore maintainable
Combine custom ignore rules and templates from github/gitignore.
Wouldn't it be nice to write this
test/tmp
#==Node
#==Global/VisualStudioCode
instead of this?
test/tmp
## getignore: https://raw.githubusercontent.com/github/gitignore/master/Node.gitignore ##
# Logs
logs
*.log
npm-debug.log*
[54 lines more...]
## getignore: https://raw.githubusercontent.com/github/gitignore/master/Global/VisualStudioCode.gitignore ##
.vscode/*
!.vscode/settings.json
[3 lines more ...]
Or to include your custom ignore rules, but in an organized way?
#=file://support/CustomProject.gitignore
#=file://support/CustomDependency.gitignore
#==Node
Installation
npm install -g getignore
Usually you want to install this with the global flag, so that you have it available across your system. For npm projects you can also set it as a development dependency.
npm install --save-dev getignore
Usage
Write the ignore rules into .getignore
and then run getignore
to generate .gitignore
.
The .gitignore
file gets overridden! But this is what you want and you are using version control anyway, so that should not be a problem.
Syntax
- default gitignore rules
-
#=<url>
- fetchurl
and replace (supported protocols are HTTP and HTTPS and the file system)#=http://...
#=https://...
#=file://...
-
#==<name>
- fetchname
from github/gitignore and replace
The syntax for .getignore
files is the same syntax as for .gitignore
files. But on top of that, every line beginning with #=
is fetched and replaced. #==
fetches from github/gitignore.