How to create gitignore file with predefined templates?

ycmjason profile image Jason Yu ・1 min read

For people who create project frequently, one thing that is very annoying would be creating the gitignore file. The same set of files, but why write it again. Even copying from other directory is a waste of effort. This is why I have created gitignorer.

To install this program, simply run:

> npm i -g gitignorer

This program allow you to create the gitignore file with a predefined set of files. For example:

> gitignore init node
# created by gitignorer
# profile used: node

Isn’t this great?

All the profiles are defined at ~/.gitignore.profiles.js. The definition is simple and intuitive. Here is one of the examples:

/*** ~/.gitignore.profiles.js ***/
var common = [

var node = [

var java = [
  'url: https://raw.githubusercontent.com/github/gitignore/master/Java.gitignore',

module.exports = {
  default: common,
  node: [...common, ...node],
  java: [...common, ...java],
  awesome: [...commone, ...node, ...java],

Posted on by:

ycmjason profile

Jason Yu


Jason Yu is a passionate real-life problem solver and musician.


markdown guide