Gitignore.io Template Fork
Growing Beyond GitHub’s gitignore Template List #
Since Feb 13, 2013, gitignore.io relied on GitHub’s list of gitignore templates to power the website. GitHub maintains the most popular gitignore template list as reflected by it’s 50,000+ stars. As gitignore.io grows, our community faces challenges relying on GitHub’s template list.
Responsiveness - GitHub maintains a popular template list, but is slow to merge pull requests. This results in slow updates to templates and certain developers simply abandoning their requests.
Acceptance - gitignore templates must meet contributing guideline requirements preventing merges from small and undocumented projects. As a result, gitignore.io already has twice as many gitignore templates.
Composition - Larger templates, such as the
Objective-C.gitignore, can not be composed from smaller templates.
Objective-C.gitignoreincludes Cocoapods, Carthage, Fastlane, and iOSInjectionProject which should all be separate templates.
Inheritance - The JetBrains template is an example where one template has multiple uses. All Idea IDE’s ignore the same core list of files. If a C++ developer is working in CLion, the CLion template should inherit from the JetBrains template.
Extension - GitHub’s original template list challenged developers who wanted functionality but were not accepted because point 1 and 2. The community needed a way to make changes that weren’t accepted by the main repository, but still made sense.
The Plan #
Todays fork plans to address all five issues.
Responsiveness - I am migrating to the https://github.com/dvcs/gitignore repository with the goal of merging pull requests and/or providing feedback within 5 days.
Acceptance - I will accept all templates that make sense. If you have a new template or modification to an existing template, I will merge it. Occasionally, developers submit templates without fully understanding the architecture of gitignore.io so I will work to make sure each pull request can be merged using one of the following three features.
Composition - I’m introducing a new
.stackfile extension to support composition. The
ReactNativetemplate combines multiple templates with the stack design pattern.
Here is the example for React Native:
// Base - Base template ReactNative.gitignore // Stack - Templates added to the base template [email protected] -> Android.gitignore [email protected] -> Buck.gitignore [email protected] -> Gradle.gitignore [email protected] -> Linux.gitignore [email protected] -> Node.gitignore [email protected] -> Xcode.gitignore [email protected] -> macOS.gitignore
There is a base react native template, then each stack with follows the format
Gitignore.io’s template generation engine will compose all of the stacks into the final template at run-time resulting in the final template.
Inheritance - This happens through symlinks from the child to the parent template. JetBrains is the largest collection of templates that use symlinks on gitignore.io.
JetBrains.gitignore [email protected] -> JetBrains.gitignore [email protected] -> JetBrains.gitignore [email protected] -> JetBrains.gitignore [email protected] -> JetBrains.gitignore [email protected] -> JetBrains.gitignore [email protected] -> JetBrains.gitignore [email protected] -> JetBrains.gitignore [email protected] -> JetBrains.gitignore [email protected] -> JetBrains.gitignore
Extension - The
.patchfile extension allows gitignore.io to extend a template without modifying the original. This was extremely useful allowing gitignore.io to add ignore patterns to neglected templates. As gitignore.io cleans up the template list, this will see less usage.
Going forward #
Use - If you need to create a useful gitignore file for your project, checkout https://www.gitignore.io. It also has a command line API.
Support - If you like the project, please give the gitignore.io and template repositories a star.
Contribute - Please submit a pull request if you have a project with
.giignoretemplate that is not in our repository.