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

3 messages from 2023-04-26 to 2023-04-26. Participants: ParetoOptimalDev, Erik Cervin Edin.
Thread: https://gitlist.dev/t/59657

## ParetoOptimalDev, 2023-04-26 05:59

Subject: With git+ssh deprecated, how can multiple git identities be managed?
Message-ID: <87h6t3rxod.fsf@mailfence.com>
URL: https://gitlist.dev/e/87h6t3rxod.fsf%40mailfence.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.


```

## Erik Cervin Edin, 2023-04-26 06:25

Subject: Re: With git+ssh deprecated, how can multiple git identities be managed?
Message-ID: <CA+JQ7M-jjzWFg-fV=zm1TLPibFZZyRz4-uojyUa9vwjRcf47Sw@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2BJQ7M-jjzWFg-fV%3Dzm1TLPibFZZyRz4-uojyUa9vwjRcf47Sw%40mail.gmail.com
In-Reply-To: <87h6t3rxod.fsf@mailfence.com>

```
On Wed, Apr 26, 2023 at 8:11 AM ParetoOptimalDev
<pareto.optimal@mailfence.com> wrote:
>
> 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.

Maybe I can't see the forest for the trees but why can't you use
  ssh://paretooptimal-work/some-work/codebase.git
  ssh://paretooptimal-personal/some-personal/codebase.git
instead?

```

## ParetoOptimalDev, 2023-04-26 06:38

Subject: Re: With git+ssh deprecated, how can multiple git identities be managed?
Message-ID: <878refrvuv.fsf@mailfence.com>
URL: https://gitlist.dev/e/878refrvuv.fsf%40mailfence.com
In-Reply-To: <CA+JQ7M-jjzWFg-fV=zm1TLPibFZZyRz4-uojyUa9vwjRcf47Sw@mail.gmail.com>

```
Erik Cervin Edin <erik@cervined.in> writes:

> On Wed, Apr 26, 2023 at 8:11 AM ParetoOptimalDev
> <pareto.optimal@mailfence.com> wrote:
>>
>> 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.
>
> Maybe I can't see the forest for the trees but why can't you use
>   ssh://paretooptimal-work/some-work/codebase.git
>   ssh://paretooptimal-personal/some-personal/codebase.git
> instead?

Wow... yes I just cloned a repo with just `ssh://` rather than
`git+ssh://` and it works perfectly fine.

I simply didn't know that `ssh://` could be used and mistook deprecation
of `git+ssh` as deprecation of git integration with the ssh protocol.

Thank you!

```
