{"thread":{"id":"59657","subject":"With git+ssh deprecated, how can multiple git identities be managed?","startedAt":"2023-04-26T06:10:09Z","lastAt":"2023-04-26T06:46:15Z","messageCount":3,"participants":["ParetoOptimalDev","Erik Cervin Edin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"476088","messageId":"87h6t3rxod.fsf@mailfence.com","threadId":"59657","inReplyTo":null,"subject":"With git+ssh deprecated, how can multiple git identities be managed?","fromName":"ParetoOptimalDev","fromEmail":"pareto.optimal@mailfence.com","sentAt":"2023-04-26T05:59:30Z","receivedAt":"2023-04-26T06:10:09Z","isPatch":false,"sender":{"key":"pareto.optimal@mailfence.com","avatar":null},"body":"\nHello all.\n\nFor instance with git+ssh I would have the following in my\n~/.ssh/config:\n\n```\nHost paretooptimal-personal\n  User git\n  HostName github.com\n  IdentityFile /run/agenix/pareto_optimal_personal_priv\n\nHost paretooptimal-work\n  User git\n  HostName github.com\n  IdentityFile /run/agenix/pareto_optimal_work_priv\n```\n\nThen I could use it like `git clone\ngit+ssh://paretooptimal-work/some-work/codebase.git` or\n`git+ssh://paretooptimal-personal/some-personal/codebase.git`\nrespectively.\n\nThe problem is that since this is deprecated a tool I use in emacs called forge\ndoesn't want to add support for this type of git url because it's being deprecated:\n\nhttps://github.com/magit/forge/issues/545\n\nThat's valid and understandable, but I feel like I have a valid use case\nthat calls into question the deprecation of these urls.\n\nSo my desire here is to have a solution for multiple git identities that\nisn't deprecated and is supported in forge, or is a feature that can be\nadded using non-deprecated git functionality.\n\nUn-deprecating git+ssh urls would be one possible solution, but if I had\nto bet I'd say the case I make won't be compelling enough ;)\n\nEither that, or some other way of accomplishing this is possible. Or\nperhaps, this isn't a use case the git project thinks is worth\nsupporting.\n\nI also have another case for `git+ssh` urls to create private git\nrepositories authenticated by ssh key. I'm fairly sure there isn't a\nbetter solution for that.\n\nIf one needs a more concrete example of the private git repository use\ncase using `git+ssh`, I typically use it to create private Nix flakes.\n\nNix flakes: https://www.tweag.io/blog/2020-05-25-flakes/\n\nThank you for your time and consideration.\n\n"},{"id":"476090","messageId":"CA+JQ7M-jjzWFg-fV=zm1TLPibFZZyRz4-uojyUa9vwjRcf47Sw@mail.gmail.com","threadId":"59657","inReplyTo":"87h6t3rxod.fsf@mailfence.com","subject":"Re: With git+ssh deprecated, how can multiple git identities be managed?","fromName":"Erik Cervin Edin","fromEmail":"erik@cervined.in","sentAt":"2023-04-26T06:25:52Z","receivedAt":"2023-04-26T06:28:21Z","isPatch":false,"sender":{"key":"erik@cervined.in","avatar":null},"body":"On Wed, Apr 26, 2023 at 8:11 AM ParetoOptimalDev\n<pareto.optimal@mailfence.com> wrote:\n>\n> Then I could use it like `git clone\n> git+ssh://paretooptimal-work/some-work/codebase.git` or\n> `git+ssh://paretooptimal-personal/some-personal/codebase.git`\n> respectively.\n\nMaybe I can't see the forest for the trees but why can't you use\n  ssh://paretooptimal-work/some-work/codebase.git\n  ssh://paretooptimal-personal/some-personal/codebase.git\ninstead?\n"},{"id":"476092","messageId":"878refrvuv.fsf@mailfence.com","threadId":"59657","inReplyTo":"CA+JQ7M-jjzWFg-fV=zm1TLPibFZZyRz4-uojyUa9vwjRcf47Sw@mail.gmail.com","subject":"Re: With git+ssh deprecated, how can multiple git identities be managed?","fromName":"ParetoOptimalDev","fromEmail":"pareto.optimal@mailfence.com","sentAt":"2023-04-26T06:38:48Z","receivedAt":"2023-04-26T06:46:15Z","isPatch":false,"sender":{"key":"pareto.optimal@mailfence.com","avatar":null},"body":"Erik Cervin Edin <erik@cervined.in> writes:\n\n> On Wed, Apr 26, 2023 at 8:11 AM ParetoOptimalDev\n> <pareto.optimal@mailfence.com> wrote:\n>>\n>> Then I could use it like `git clone\n>> git+ssh://paretooptimal-work/some-work/codebase.git` or\n>> `git+ssh://paretooptimal-personal/some-personal/codebase.git`\n>> respectively.\n>\n> Maybe I can't see the forest for the trees but why can't you use\n>   ssh://paretooptimal-work/some-work/codebase.git\n>   ssh://paretooptimal-personal/some-personal/codebase.git\n> instead?\n\nWow... yes I just cloned a repo with just `ssh://` rather than\n`git+ssh://` and it works perfectly fine.\n\nI simply didn't know that `ssh://` could be used and mistook deprecation\nof `git+ssh` as deprecation of git integration with the ssh protocol.\n\nThank you!\n"}]}