gogs / gogs

Gogs is a painless self-hosted Git service
https://gogs.io
MIT License
44.85k stars 4.85k forks source link

Wrong path in SSH clone #7287

Closed monochromec closed 1 year ago

monochromec commented 1 year ago

Gogs version

0.11.91

Git version

Operating system

Bullseye

Database

SQLite 3.34.1

Describe the bug

When cloning a repo with the relative URL as displayed in the web UI, I get an error message instead of cloning the repo. Cloning with an absolute path works

To reproduce

git clone gogs_user@host:user/repo.git
Cloning into 'repo'...
fatal: 'user/repo.git' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Expected behavior

git clone gogs_user@host:/home/gogs_user/gogs-repositories/user/repo.git
Cloning into 'repo'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (3/3), done.

Additional context

app.ini setting:

[repository]
ROOT = /home/gogs_user/gogs-repositories

More than happy to provide additional information, just let me know.

Code of Conduct

dawescc commented 1 year ago

Try instead to use

git clone gogs_user@host:user/repo.git

Does that work?

monochromec commented 1 year ago

Managed to solve this by creating an organisation first and then a repo belonging to this.