~/.ssh/config
Host github.com-work
HostName github.com
User git
IdentityFile ~/.ssh/work_id_rsa
IdentitiesOnly yes
~/.git/config [user]
email = work@example.com
[remote "origin"]
url = github.com-work:Work/Widget.gitIn my main ~/.gitconfig I have:
[includeIf "gitdir:/home/user/projects/embedding-shapes/"]
path = /home/user/.gitconfig-embedding-shapes
Where basically `projects/` follow GitHub naming with $user/$repo, so I set the git identity based on all projects within that user, rather than repo-by-repo which would get cumbersome fast.Then you just make sure you're in the right directory :)
[0] https://www.dvratil.cz/2015/12/git-trick-%23628-automaticall...
rgoulter•1h ago