Dev Life
·1 min read·

How to save time using global .gitignore

Main cover illustration for article: How to save time using global .gitignore
Summarize with AI:

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.

touch ~/.gitignore

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

.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 Lukas Blazek on Unsplash

Part of the Dev Life Series

Reflections on career, soft skills, productivity, and the human side of programming.

View Entire Series

Related Articles

Share this article

If you found this guide helpful, consider sharing it with your team or fellow developers.


Real Software. Real Lessons.

I share the lessons I learned the hard way, so you can either avoid them or be ready when they happen.

User avatar
User avatar
User avatar
User avatar
+13K

Join 13,800+ developers and readers.

No spam ever. Unsubscribe at any time.