|
I'm familiar with the usual recommendations to use But there appear to a be a lot of interesting ways to do this with Git. I'm not sure which (if any) work with Jujutsu -- in particular, non-colocated JJ repos. See also: https://stackoverflow.com/questions/3225862/multiple-github-accounts-ssh-config |
Replies: 2 comments 1 reply
|
You could try something like this if you really want to: https://stackoverflow.com/a/79696990 (from https://stackoverflow.com/questions/79144586/how-to-match-ssh-config-based-on-directory-path) Even in a non-colocated repo, jj will shell out to git, which will shell out to ssh, so it should work (if you are curious, This is not really a recommendation, only try this if it seems fun. I haven't tested it, and there will likely be rough edges to figure out. For example it may not work correctly in a workspace and it will not work correctly with If somebody can think of a better way, that could be more useful. |
|
Here is what worked for me: # ~/.ssh/config
Host gitlab-bigfoot
Hostname gitlab.com
User git # convenient, used below...
IdentityFile ~/.ssh/id_bigfoot_gitlab_ed25519
IdentitiesOnly yes # often recommended in this situation
AddKeysToAgent yes # might be macOS specific
UseKeychain yes # macOS specificThis works because |
Here is what worked for me:
This works because
Hostmaps toHostname. When adding a Git remote to JJ use e.g.: