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 = [email protected]
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
Main/default config (~/.gitconfig):
Then in .gitconfig-user-{a,b}: Or, even more separation, create separate users/accounts on the computers you use.