6

I'm new to git, and I'm doubting how can I synchronize config files between developers.

Let's say I want all developers to have core.autocrlf set to true, or the same commit template, how can I do it?

Any idea?

Thanks!

4
  • What platform are your developers on? Is it homogeneous? Commented Jan 27, 2010 at 5:28
  • At the moment, Linux. But it is possible that some wind*ws developers will be working in the same project. But I also want other configuration flags to be homogeneous between the team, like the commit template. Thanks Commented Jan 27, 2010 at 5:31
  • Check the git config files into Visual SourceSafe. Commented Jan 27, 2010 at 5:50
  • Visual SourceSafe? I'm using linux Jay Commented Jan 27, 2010 at 18:39

2 Answers 2

2

There is no such guarantee in a DVCS (as in "Distributed"), since local settings beat global settings.

But in a closed environment (where the population of developers have accessed to a common and shared set of resources), you can:

  • encapsulate the git init process (to use a template, for common settings)
  • Force the GIT_CONFIG environment variable to a shared read-only file (on Linux, accessed through Samba from Windows users), to force all config settings to be read from there.

This is not a foolproof solution, but it can get you started.

Sign up to request clarification or add additional context in comments.

Comments

0

You can keep your repo configs (remote names, urls, branching and merging options, and as in your question, CRLF settings) in a global config file, which is kept in its own separate git repository, and included from your $HOME/.gitconfig global config file.

The global configuration can use the Include and IncludeIf directives, so that various sections of it apply to various repos.

The versioned global config file becomes its own project, commonly managed by a team leader, where the team's settings are kept consistent, and distributed to the team via the familiar push/pull git mechanism.

I describe the technique I use at https://stackoverflow.com/a/79775066/7859025

Large, distributed projects like linux, git, and Microsoft's monorepo surely use a disciplined technique to manage their thousands of clones by thousands of developers, but I could not find any write-ups on how they do it, so I invented my own, and documented it in the answer above. The answer also contains a repo to my own .gitconfigs repository on github where I keep configs for the public projects I am involved in.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.