How to Ignore Files in Git Globally (.DS_Store)

Опубликовано: 14 Октябрь 2024
на канале: Code Wizard
889
20

I'll show you how to ignore files in git globally. This means that files and folders can be ignored for all projects, not just one project. I'll show you specifically how to ignore the annoying .DS_Store file, which is common in MacOS.

If you get an error because the .gitignore_global file doesn't exist, all you have to do is create the file with: touch ~/.gitignore_global

How to ignore files in a single project with git?
Answer: for this, just create a .gitignore file in the root directory of your project and then add the files and folders you want to ignore. Done.