Skip to content

Instantly share code, notes, and snippets.

@theetrain
Created August 14, 2020 21:34
Show Gist options
  • Save theetrain/74cead2d6cf542cb35433912c7e0805d to your computer and use it in GitHub Desktop.
Save theetrain/74cead2d6cf542cb35433912c7e0805d to your computer and use it in GitHub Desktop.
Conditional .gitignore based on path (all example files can be saved in your ~/ directory)
# Global .gitignore for all git projects
[core]
excludesFile = ~/.gitignore
# Project-specific Settings
[includeIf "gitdir:~/repos/projectgroup/"]
path = ~/.gitconfig-projectgroup
[core]
excludesFile = ~/.gitignore-projectgroup
# Applies to all git projects
.DS_Store
# Applies to all git projects in the ~/repos/projectgroup directory
.vscode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment