git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Setting per-repository configuration for git

From
JRJeremy Rosen <jeremy.rosen@openwide.fr>
Date
Oct 25, 2013, 07:12 UTC
Message-ID
<834511791.9670586.1382685155770.JavaMail.root@openwide.fr>
In-Reply-To
<884520645.9668515.1382684531443.JavaMail.root@openwide.fr>
Hello everybody

I am looking into the git configuration mechanism and there seem to be a "hole" in use cases I'm trying to figure out...

git configurations can be saved at various places
* /etc/gitconfig : system-wide configuration
* ~/.gitconfig : user-wide configuration
* .git/config : repository-wide configuration

however I can't find a way to have the repository's configuration saved and transmited with the repository in a way similar to how .gitignore is transmitted...

Saving some configuration information within a repository is not unknown in git. .gitignore does it, and submodule configuration does it to.

I think it's important to have a way to have configuration options
be saved in a repository (and overridable with .git/config which 
is local-repository only) because a lot of configurationoptions
 are meant to express repository policies (triangular workflows,
merge vs rebase, mail vs push) and it would make sense to have
them transmitted that way.

Knowing how mature git is I can only assume that this has already been discussed and that there is a good reason not to do it. Is it because of hooks ? would it break something I don't see in git ?

git (the project) shouldn't enforce policies on repositories, but I think it makes sense for repositories to have a way to set default policies on their clone...

Thx
Cordialement 

Jérémy Rosen +33 (0)1 42 68 28 04

fight key loggers : write some perl using vim 
Open Wide Ingenierie

23, rue Daviel 75012 Paris - France www.openwide.fr

Next: Jeff King
Message 1 of 3 in “Setting per-repository configuration for git”
  1. Jeremy RosenOct 25, 2013
  2. Jeff KingOct 25, 2013
  3. Jakub NarebskiOct 25, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.