git/list[1] front-page[2] threads[3] people[4] search[5] about
 

With git+ssh deprecated, how can multiple git identities be managed?

From
PParetoOptimalDev <pareto.optimal@mailfence.com>
Date
Apr 26, 2023, 05:59 UTC
Message-ID
<87h6t3rxod.fsf@mailfence.com>
Hello all.

For instance with git+ssh I would have the following in my ~/.ssh/config:

```
Host paretooptimal-personal
  User git
  HostName github.com
  IdentityFile /run/agenix/pareto_optimal_personal_priv
Host paretooptimal-work
  User git
  HostName github.com
  IdentityFile /run/agenix/pareto_optimal_work_priv
```

Then I could use it like `git clone git+ssh://paretooptimal-work/some-work/codebase.git` or `git+ssh://paretooptimal-personal/some-personal/codebase.git` respectively.

The problem is that since this is deprecated a tool I use in emacs called forge doesn't want to add support for this type of git url because it's being deprecated:

https://github.com/magit/forge/issues/545

That's valid and understandable, but I feel like I have a valid use case that calls into question the deprecation of these urls.

So my desire here is to have a solution for multiple git identities that isn't deprecated and is supported in forge, or is a feature that can be added using non-deprecated git functionality.

Un-deprecating git+ssh urls would be one possible solution, but if I had to bet I'd say the case I make won't be compelling enough ;)

Either that, or some other way of accomplishing this is possible. Or perhaps, this isn't a use case the git project thinks is worth supporting.

I also have another case for `git+ssh` urls to create private git repositories authenticated by ssh key. I'm fairly sure there isn't a better solution for that.

If one needs a more concrete example of the private git repository use case using `git+ssh`, I typically use it to create private Nix flakes.

Nix flakes: https://www.tweag.io/blog/2020-05-25-flakes/
Thank you for your time and consideration.
Next: Erik Cervin Edin
Message 1 of 3 in “With git+ssh deprecated, how can multiple git identities be managed?”
  1. ParetoOptimalDevApr 26, 2023
  2. Erik Cervin EdinApr 26, 2023
  3. ParetoOptimalDevApr 26, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.