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

Re: Multiple --global config workspaces?

From
RReto <reto@labrat.space>
Date
Oct 11, 2022, 05:51 UTC
Message-ID
<20221011055130.gvoh44rbulg3f4jn@feather>
In-Reply-To
<C4E3A512-2E2C-4EA5-9F2E-3662BCF0F165@elsiehupp.com>
On Mon, Oct 10, 2022 at 11:06:32PM -0400, Elsie Hupp wrote:
> What might possibly help in this situation could be if I could have the global ~/.gitconfig somehow delegate to separate .gitconfig files in each of the workspace folders I have set up, e.g.:
> ~/Repositories/github/.gitconfig
> ~/Repositories/gitlab/.gitconfig

That already exists, git-config(1), look for "Conditional includes" That way you can do it per top level folder or whatever makes sense for you.

Examples:
; include for all repositories inside /path/to/group
[includeIf "gitdir:/path/to/group/"]
	   path = /path/to/foo.inc
; include for all repositories inside $HOME/to/group
[includeIf "gitdir:~/to/group/"]
	   path = /path/to/foo.inc
Previous: Philip Oakley
Message 14 of 14 in “Multiple --global config workspaces?”
  1. Elsie HuppOct 11, 2022
  2. Junio C HamanoOct 11, 2022
  3. Jeff KingOct 11, 2022
  4. Elsie HuppOct 11, 2022
  5. Elsie HuppOct 11, 2022
  6. Jeff KingOct 14, 2022
  7. Matthias AßhauerOct 15, 2022
  8. Jeff KingOct 15, 2022
  9. Elsie HuppOct 18, 2022
  10. Jeff KingOct 18, 2022
  11. Elsie HuppOct 20, 2022
  12. Elsie HuppOct 20, 2022
  13. Philip OakleyOct 11, 2022
  14. RetoOct 11, 2022

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.