---
title: "How to save time using global .gitignore"
date: "2020-11-02"
slug: "how-to-save-time-using-global-gitignore"
author: "Dany Paredes"
canonical: "https://danywalls.com/how-to-save-time-using-global-gitignore"
description: "Sometimes we ignore the duplicate files for every project.DS_Store or npm-debug.log*, we can save time using a global .gitignore.\nNote: Be Keep in mind that it will change your default behavior on your computer. If you share a project, be careful wh..."
---

Sometimes we ignore the duplicate files for every project.DS_Store or npm-debug.log*, we can save time using a global .gitignore.

>Note: Be Keep in mind that it will change your default behavior on your computer. If you share a project, be careful which directories you set into it. For example, if you add >node_modules/, then you can't add or .vscode.


These steps work in Linux and Mac.

1- Create gitignore in the root path.
```bash
touch ~/.gitignore
```

Edit the .gitignore and include these files you always need to ignore.

```bash
.nyc_output
.DS_Store
npm-debug.log*
```

From terminal configure git where the gitignore file to be stored.
```
git config --global core.excludesfile '~/.gitignore'
```

Done!!!

Photo by <a href="https://unsplash.com/@goumbik?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Lukas Blazek</a> on <a href="https://unsplash.com/s/photos/time?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
  

