Re: Multiple --global config workspaces?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Elsie Hupp <git@xxxxxxxxxxxxx> writes:

> I structure my cloned repositories based on the remote host, e.g.:
>
> ~/Repositories/github/cloned-repository-name
> ~/Repositories/gitlab/other-cloned-repository-name

The above is by definition not "global" (aka "per user").

"--global" is for things that are of your personal preference, not
"when I am working on this project, these settings apply" (which is
suitable for "per repository").

What you want is a way to say "when I am working on these projects,
these settings apply".

One way to do this would be to have

	[includeIf "gitdir:~/Repositories/github/"] path = $HOME/.githubconfig
	[includeIf "gitdir:~/Repositories/gitlab/"] path = $HOME/.gitlabconfig

in $HOME/.gitconfig and then write in these two extra files that are
conditionally included whatever settings you want to use for any and
all repositories that come from GitHub or GitLab.

$ git help config

and look for Conditional includes, perhaps?





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux