19.1.2022 |

Global Git Ignore files

Projects should not care about what OS or editor you are using. Git ignore files are perfect for excluding file you don't want inside your git history. One of those files is usually your editor configuration. As this is rarely project specific and may include personal settings which won't help other developers. But adding your personal editor of choice to every project you work on is tedious. In those cases a global git ignore file is a perfect solution.

As part of your users git config file you configure a global git ignore file. (While writing this I saw that it maybe also works by placing the ignore file at $HOME/.config/git/ignore. But I haven't tested that yet)


[core]
	excludesfile = /Users/jansauer/.gitignore_global

In that file you can then add the patterns you want ignored in all projects.

# Folder view configuration files
.DS_Store
Desktop.ini

# Thumbnail cache files
._*
Thumbs.db

# Files that might appear on external disks
.Spotlight-V100
.Trashes

# Visual Studio Code
.vscode/

# JetBrains
.idea/
.iml
Jan Sauer
Zur Übersicht

Mehr vom DevSquad...

Jörg Herbst

Fullscreen im Firefox

Sophia Brandt

Git: Stelle den Kommentiercharakter auf "auto"