|
|
|
|
|
by diggan
980 days ago
|
|
Different gitconfigs per path on disk, git automatically uses the right identity depending on where you are on disk. Allows you to separate all projects into different users and every repository within those directories will use the specified user. Main/default config (~/.gitconfig): [user]
email = git@victor.earth
name = Victor Bjelkholm
[includeIf "gitdir:/home/user/projects/user-a/"]
path = /home/user/.gitconfig-user-a
[includeIf "gitdir:/home/user/projects/user-b/"]
path = /home/user/.gitconfig-user-b
Then in .gitconfig-user-{a,b}: [user]
name = UserA
email = UserA@DomainA.local
[core]
sshCommand = ssh -i /home/user/.ssh/user_a_id_ed25519
Or, even more separation, create separate users/accounts on the computers you use. |
|