icyphox / legit

web frontend for git
https://git.icyphox.sh
MIT License
376 stars 25 forks source link

Unable to clone #3

Closed yonas closed 1 year ago

yonas commented 1 year ago

Steps to reproduce:

  1. mkdir -p /var/www/git ; cd /var/www/git
  2. git clone https://github.com/zyedidia/micro
  3. clone, build, and run the legit server: git clone ... ; go build -v . ; ./legit
  4. git clone http://127.0.0.1:5555/micro

2022/12/19 09:01:48 repo-init: /var/www/git/micro does not exist

icyphox commented 1 year ago

Hey, this is likely because your repository isn’t a bare repo. You will need to git init --bare micro, push to it, and then try cloning.

quaintdev commented 1 year ago

Do you mean that project only supports bare repos?

If this is the case then I think this should be mentioned on the Readme because for most of us the repos will not be bare.

icyphox commented 1 year ago

@quaintdev cloning is only supported in bare repos—this is a limitation inherent to git, and not legit. You can still view non-bare repos just fine in legit. But yes, I will add a line clarifying this.

icyphox commented 1 year ago

This is done: https://github.com/icyphox/legit/commit/42bce06630791cfe158f65769bb88e1a619b68e0

quaintdev commented 1 year ago

@icyphox I actually learned about this concept after seeing your previous comment so I might be missing something obvious here but I did not have to do this for Gitea or GitHub. Is there a fundamental difference between how these other GUI frontend and legit works?

I thought legit is just barebones but is similar to GitHub/Gitea.

icyphox commented 1 year ago

legit is indeed barebones, just a lot more than GitHub/Gitea. GitHub/Gitea allow you to create repositories via the UI; under the hood, they simply create a bare repository for you, and give you a push https push URL (or ssh).

In the case of legit, the assumption is that you already have a bunch of bare git repos that you push to via ssh (or whatever), and you can ask legit to serve those. Ultimately, this is just a self-hosted read-only front end for your git repos. Being a full-featured git forge like GitHub/Gitea is not the goal.

quaintdev commented 1 year ago

@icyphox Makes sense. Thank you!