oliverdavies.uk/content/node.bbb0f7dc-a5f9-4f11-8a33-f8b234c0cc89.yml

96 lines
3.8 KiB
YAML

uuid:
- value: bbb0f7dc-a5f9-4f11-8a33-f8b234c0cc89
langcode:
- value: en
type:
- target_id: daily_email
target_type: node_type
target_uuid: 8bde1f2f-eef9-4f2d-ae9c-96921f8193d7
revision_timestamp:
- value: '2025-05-11T09:00:20+00:00'
revision_uid:
- target_type: user
target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849
revision_log: { }
status:
- value: true
uid:
- target_type: user
target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849
title:
- value: 'Ignoring things globally'
created:
- value: '2024-01-28T00:00:00+00:00'
changed:
- value: '2025-05-11T09:00:20+00:00'
promote:
- value: false
sticky:
- value: false
default_langcode:
- value: true
revision_translation_affected:
- value: true
path:
- alias: /daily/2024/01/28/ignoring-things-globally
langcode: en
body:
- value: |
<p>Yesterday's email was about repository-specific .gitignore files and different ways to write them.</p>
<p>But there's a setting that most people don't know about, where you can configure a global <code>.gitignore</code> file.</p>
<h2 id="what-i-use-it-for">What I use it for</h2>
<p>Whilst it doesn't replace repository-specific files, it's good for operating system-specific files - such as <code>.DS_Store</code> files on macOS.</p>
<p>I have a convention where I have a <code>.ignored</code> directory in a project, and everything in it should be ignored by Git.</p>
<p>Instead of adding this to every <code>.gitignore</code> file, and because it's specific to me, it's a good choice for a global ignore file.</p>
<p>Anything that affects multiple users - such as ignoring <code>vendor</code> or <code>node_modules</code> should still be set in each repository.</p>
<h2 id="how-do-you-add-it%3F">How do you add it?</h2>
<p>Add this to your <code>~/.gitconfig</code> or <code>~/.config/git/config</code> file to set the path for your global ignore file:</p>
<pre><code class="language-plain">[core]
excludesFile = "~/.config/git/ignore"
</code></pre>
<p>Then, create the file and add what you want to ignore everywhere.</p>
<p>Just remember this is specific to you, and if others have something you've ignored globally and they haven't, they could still add and commit it.</p>
format: full_html
processed: |
<p>Yesterday's email was about repository-specific .gitignore files and different ways to write them.</p>
<p>But there's a setting that most people don't know about, where you can configure a global <code>.gitignore</code> file.</p>
<h2 id="what-i-use-it-for">What I use it for</h2>
<p>Whilst it doesn't replace repository-specific files, it's good for operating system-specific files - such as <code>.DS_Store</code> files on macOS.</p>
<p>I have a convention where I have a <code>.ignored</code> directory in a project, and everything in it should be ignored by Git.</p>
<p>Instead of adding this to every <code>.gitignore</code> file, and because it's specific to me, it's a good choice for a global ignore file.</p>
<p>Anything that affects multiple users - such as ignoring <code>vendor</code> or <code>node_modules</code> should still be set in each repository.</p>
<h2 id="how-do-you-add-it%3F">How do you add it?</h2>
<p>Add this to your <code>~/.gitconfig</code> or <code>~/.config/git/config</code> file to set the path for your global ignore file:</p>
<pre><code class="language-plain">[core]
excludesFile = "~/.config/git/ignore"
</code></pre>
<p>Then, create the file and add what you want to ignore everywhere.</p>
<p>Just remember this is specific to you, and if others have something you've ignored globally and they haven't, they could still add and commit it.</p>
summary: null
field_daily_email_cta: { }