Re: Multiple --global config workspaces?
- From
- Reto <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