Add a default `.gitignore` to project template
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3500134. --> Reported by: [tyler36](https://www.drupal.org/user/3660893) Related to !537 !455 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>I recently spun up a Drupal CMS `1.0.0` project.<br> After initiallizing Git, when I view the Source Control panel in VSCode (<code>1.96.3</code>):</p> <p>"Too many changes were detected. Only the first 10000 changes will be shown below."</p> <p>This feels overwhelming, especially for new developers.<br> My philosphy with non-drupal projects has been _not_ to commit vendor folder in favor of composer managing it.<br> This results in smaller repos. Several VSCode features/extensions (such as searching, or linting) can also exclude files from gitignore automatically.</p> <p>Since Drupal 8, I've used <a href="https://github.com/github/gitignore/blob/main/Drupal.gitignore">https://github.com/github/gitignore/blob/main/Drupal.gitignore</a> , via VSCode extension, as a base <code>.gitignore</code> file. However, that has not been updated in 5 years.</p> <p>There is currently an issue, <a href="https://www.drupal.org/project/drupal/issues/3082958">https://www.drupal.org/project/drupal/issues/3082958</a> , to add something to Drupal Core, but that is now also 5+ years old. </p> <p>@phenaproxima suggested on Slack that "We don&rsquo;t have to wait for core to do stuff like this" and encourage me to open an issue.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>1. Install Drupal CMS via composer<br> 2. Initialize a new reposito: <code>git init</code></p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Add a base <code>.gitignore</code> that includes files generally managed by composer.<br> This could include folders like:<br> - <code>recipes</code><br> - <code>/web/libraries/</code><br> - <code>/web/modules/contrib/</code><br> - <code>/web/themes/contrib/</code><br> - <code>/web/profiles/drupal_cms_installer/</code></p> <p>I have attached a starting point file <code>.gitignore.info</code>. The file should be renamed to <code>.gitignore</code> for testing (<code>.gitignore</code> is not a valid upload type).</p> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> > Related issue: [Issue #3257119](https://www.drupal.org/node/3257119) > Related issue: [Issue #3489119](https://www.drupal.org/node/3489119)
issue