| 1 | # A collection of `.gitignore` templates |
| 2 | |
| 3 | This is GitHub’s collection of [`.gitignore`][man] file templates. |
| 4 | We use this list to populate the `.gitignore` template choosers available |
| 5 | in the GitHub.com interface when creating new repositories and files. |
| 6 | |
| 7 | For more information about how `.gitignore` files work, and how to use them, |
| 8 | the following resources are a great place to start: |
| 9 | |
| 10 | - The [Ignoring Files chapter][chapter] of the [Pro Git][progit] book. |
| 11 | - The [Ignoring Files article][help] on the GitHub Help site. |
| 12 | - The [gitignore(5)][man] manual page. |
| 13 | |
| 14 | [man]: http://git-scm.com/docs/gitignore |
| 15 | [help]: https://help.github.com/articles/ignoring-files |
| 16 | [chapter]: https://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository#_ignoring |
| 17 | [progit]: http://git-scm.com/book |
| 18 | |
| 19 | ## Folder structure |
| 20 | |
| 21 | We support a collection of templates, organized in this way: |
| 22 | |
| 23 | - the root folder contains templates in common use, to help people get started |
| 24 | with popular programming languages and technologies. These define a meaningful |
| 25 | set of rules to help get started, and ensure you are not committing |
| 26 | unimportant files into your repository |
| 27 | - [`Global`](./Global) contains templates for various editors, tools and |
| 28 | operating systems that can be used in different situations. It is recommended |
| 29 | that you either [add these to your global template](https://help.github.com/articles/ignoring-files/#create-a-global-gitignore) |
| 30 | or merge these rules into your project-specific templates if you want to use |
| 31 | them permanently. |
| 32 | - [`community`](./community) contains specialized templates for other popular |
| 33 | languages, tools and project, which don't currently belong in the mainstream |
| 34 | templates. These should be added to your project-specific templates when you |
| 35 | decide to adopt the framework or tool. |
| 36 | |
| 37 | ## What makes a good template? |
| 38 | |
| 39 | A template should contain a set of rules to help Git repositories work with a |
| 40 | specific programming language, framework, tool or environment. |
| 41 | |
| 42 | If it's not possible to curate a small set of useful rules for this situation, |
| 43 | then the template is not a good fit for this collection. |
| 44 | |
| 45 | If a template is mostly a list of files installed by a particular version of |
| 46 | some software (e.g. a PHP framework), it could live under the `community` |
| 47 | directory. See [versioned templates](#versioned-templates) for more details. |
| 48 | |
| 49 | If you have a small set of rules, or want to support a technology that is not |
| 50 | widely in use, and still believe this will be helpful to others, please read the |
| 51 | section about [specialized templates](#specialized-templates) for more details. |
| 52 | |
| 53 | If you believe your template is important and should be highly visible, please |
| 54 | add details about the impact of the technology when you open a pull request. We |
| 55 | may not accept it immediately, but we can promote it to the root at a later date |
| 56 | based on interest. |
| 57 | |
| 58 | Please also understand that we can’t list every tool that ever existed. |
| 59 | Our aim is to curate a collection of the _most common and helpful_ templates, |
| 60 | not to make sure we cover every project possible. If we choose not to |
| 61 | include your language, tool, or project, it’s not because it’s not awesome. |
| 62 | |
| 63 | ## Contributing guidelines |
| 64 | |
| 65 | We’d love for you to help us improve this project. To help us keep this collection |
| 66 | high quality, we request that contributions adhere to the following guidelines. |
| 67 | |
| 68 | - **Provide a link to the application or project’s homepage**. Unless it’s |
| 69 | extremely popular, there’s a chance the maintainers don’t know about or use |
| 70 | the language, framework, editor, app, or project your change applies to. |
| 71 | |
| 72 | - **Provide links to documentation** supporting the change you’re making. |
| 73 | Current, canonical documentation mentioning the files being ignored is best. |
| 74 | If documentation isn’t available to support your change, do the best you can |
| 75 | to explain what the files being ignored are for. |
| 76 | |
| 77 | - **Explain why you’re making a change**. Even if it seems self-evident, please |
| 78 | take a sentence or two to tell us why your change or addition should happen. |
| 79 | It’s especially helpful to articulate why this change applies to _everyone_ |
| 80 | who works with the applicable technology, rather than just you or your team. |
| 81 | |
| 82 | - **Please consider the scope of your change**. If your change is specific to a |
| 83 | certain language or framework, then make sure the change is made to the |
| 84 | template for that language or framework, rather than to the template for an |
| 85 | editor, tool, or operating system. |
| 86 | |
| 87 | - **Please only modify _one template_ per pull request**. This helps keep pull |
| 88 | requests and feedback focused on a specific project or technology. |
| 89 | |
| 90 | In general, the more you can do to help us understand the change you’re making, |
| 91 | the more likely we’ll be to accept your contribution quickly. |
| 92 | |
| 93 | ## Versioned templates |
| 94 | |
| 95 | Some templates can change greatly between versions, and if you wish to contribute |
| 96 | to this repository we need to follow this specific flow: |
| 97 | |
| 98 | - the template at the root should be the current supported version |
| 99 | - the template at the root should not have a version in the filename (i.e. |
| 100 | "evergreen") |
| 101 | - previous versions of templates should live under `community/` |
| 102 | - previous versions of the template should embed the version in the filename, |
| 103 | for readability |
| 104 | |
| 105 | This helps ensure users get the latest version (because they'll use whatever is |
| 106 | at the root) but helps maintainers support older versions still in the wild. |
| 107 | |
| 108 | ## Specialized templates |
| 109 | |
| 110 | If you have a template that you would like to contribute, but it isn't quite |
| 111 | mainstream, please consider adding this to the `community` directory under a |
| 112 | folder that best suits where it belongs. |
| 113 | |
| 114 | The rules in your specialized template should be specific to the framework or |
| 115 | tool, and any additional templates should be mentioned in a comment in the |
| 116 | header of the template |
| 117 | |
| 118 | For example, this template might live at `community/DotNet/InforCRM.gitignore`: |
| 119 | |
| 120 | ``` |
| 121 | # gitignore template for InforCRM (formerly SalesLogix) |
| 122 | # website: https://www.infor.com/product-summary/cx/infor-crm/ |
| 123 | # |
| 124 | # Recommended: VisualStudio.gitignore |
| 125 | |
| 126 | # Ignore model files that are auto-generated |
| 127 | ModelIndex.xml |
| 128 | ExportedFiles.xml |
| 129 | |
| 130 | # Ignore deployment files |
| 131 | [Mm]odel/[Dd]eployment |
| 132 | |
| 133 | # Force include portal SupportFiles |
| 134 | !Model/Portal/*/SupportFiles/[Bb]in/ |
| 135 | !Model/Portal/PortalTemplates/*/SupportFiles/[Bb]in |
| 136 | ``` |
| 137 | |
| 138 | ## Contributing workflow |
| 139 | |
| 140 | Here’s how we suggest you go about proposing a change to this project: |
| 141 | |
| 142 | 1. [Fork this project][fork] to your account. |
| 143 | 2. [Create a branch][branch] for the change you intend to make. |
| 144 | 3. Make your changes to your fork. |
| 145 | 4. [Send a pull request][pr] from your fork’s branch to our `master` branch. |
| 146 | |
| 147 | Using the web-based interface to make changes is fine too, and will help you |
| 148 | by automatically forking the project and prompting to send a pull request too. |
| 149 | |
| 150 | [fork]: https://help.github.com/articles/fork-a-repo/ |
| 151 | [branch]: https://help.github.com/articles/creating-and-deleting-branches-within-your-repository |
| 152 | [pr]: https://help.github.com/articles/using-pull-requests/ |
| 153 | |
| 154 | ## License |
| 155 | |
| 156 | [CC0-1.0](./LICENSE). |