Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to synchronize configuration between git setups?

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!

like image 235
alcuadrado Avatar asked Jan 27 '10 05:01

alcuadrado


People also ask

How do I apply a configuration across the entire git environment?

Git stores all global configurations in . gitconfig file, which is located in your home directory. To set these configuration values as global, add the --global option, and if you omit --global option, then your configurations are specific for the current Git repository.

Is there a git sync command?

git-sync is a command that pull a git repository to a local directory. It can be used to source a container volume with the content of a git repo.

What is the git command to set configuration options?

The git config command is a convenience function that is used to set Git configuration values on a global or local project level. These configuration levels correspond to . gitconfig text files. Executing git config will modify a configuration text file.


1 Answers

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 full-proofed solution, but it can get you started.

like image 78
VonC Avatar answered Sep 20 '22 20:09

VonC