Share company-wide gitignore file

Viewed 459

Our company maintains several software projects, all versioncontrolled in different git repositories. All projects already have .gitignore files.

Question: How can I establish one single shared .gitignore file accross all company projects?

Add-on question: The file should be readonly to most people I guess. Otherwise we would run into uncontrolled changes.

Edit: What about "deploying" the .gitignore file using a custom NuGet package? Do you think this is a practical approach? It would be a pull principle and rather hard to enforce it in all projects.

2 Answers

There isn't a built-in way to do what you want. You get to figure out how to implement that.

Try adding this to your to your .gitconfig in your home directory.

[core]
  excludesFile = path/to/some/central/gitignore_global`

Not sure if it works for a gitignore_global on a network share, but I don't see any reason it wouldn't.

Related