fix: SSH repo URLs (#716)

Correct SSH URL examples to avoid confusion. Codeberg supports two different SSH URL formats with different delimiters (`:` vs `/`), but the current documentation mixes them, which can lead to misconfigurations - especially when using pattern-based Git configurations such as `includeIf "hasconfig:remote.*.url:`

There are two valid SSH URL formats when accessing Codeberg repositories:

1. SCP-like syntax (colon delimiter)
```bash
git@codeberg.org:<user>/<repo>.git
```

2. Full SSH URL syntax (slash delimiter)
```bash
ssh://git@codeberg.org/<user>/<repo>.git
```

Git treats these formats differently, so inconsistent examples in documentation can cause tools or config conditions to fail. In my case, `includeIf "hasconfig:remote.*.url:"` did not match correctly because the documented format did not reflect the proper SSH URL structure.

Reviewed-on: https://codeberg.org/Codeberg/Documentation/pulls/716
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Sepperlot <sepperlot@noreply.codeberg.org>
Co-committed-by: Sepperlot <sepperlot@noreply.codeberg.org>
This commit is contained in:
Sepperlot 2025-12-09 15:15:02 +01:00 committed by Gusted
parent eec6e02abf
commit 29c674e528

View file

@ -231,7 +231,7 @@ ssh-add # enter your passphrase once, then it is cached.
Your HTTPS URL used this format: `https://codeberg.org/<user>/<repo>.git`
The SSH URL uses this format: `git@codeberg.org:<user>/<repo>.git` (optionally with `ssh://` at the beginning like
this: `ssh://git@codeberg.org:<user>/<repo>.git`).
this: `ssh://git@codeberg.org/<user>/<repo>.git`).
Alternatively, you can find the SSH URL by going to your repository page on Codeberg
(for example, going to `https://codeberg.org/knut/foobar`), clicking on SSH in the top right corner and copying the URL.
@ -245,8 +245,8 @@ ssh-add # enter your passphrase once, then it is cached.
The output should look like this:
```bash
origin ssh://git@codeberg.org:knut/foobar.git (fetch)
origin ssh://git@codeberg.org:knut/foobar.git (push)
origin ssh://git@codeberg.org/knut/foobar.git (fetch)
origin ssh://git@codeberg.org/knut/foobar.git (push)
```
> **Attribution**