0

So far:

I have apache and git-http-backend running on my own (home) server. I can ssh to the server and create a repository. I am able to clone the servers repo locally, make changes and push back to the server.

I am going to create many small projects. On svn I used to have few repositories and the projects were simply subdirectories. svn supported to fetch only subfolders and assume they are projects. In git, I failed to clone from a subfolder, and it appears to me, that a project should be in it's own repository. My question is: How can I create a repository (actually a project) without ssh into the server. (I have ssh only enabled from within my home network, btw.)

I have tried gitweb, but that seems to be a read-only tool. I have tried to "git init --bare https://...", but that interpreted the path as a local relative path.

Ingo
  • 75
  • 1
  • 9

1 Answers1

3

If you're just using the standard git-http-backend command and Apache, then there's no way to automatically create remote repositories over HTTPS. You have to log into the server and create them by hand because Git only serves repositories that exist on the local disk already.

If you're using a tool like Gitolite, you can set up wildcard rules to allow creating repositories automatically by just cloning them.

bk2204
  • 64,793
  • 6
  • 84
  • 100
  • I'll try gitolite, then. – Ingo Oct 30 '21 at 21:00
  • I looked into gitolite and found, that it a) still uses ssh rather than https and every user seems to need a public key on the server. That would require to setup the NAT device to support ssh forwarding to the server and it will still not handle subdomains the way apache does. So, I will be looking for alternatives, before actually trying this out. Wouldn't be itlab, gitea and the like be closer to what I want? – Ingo Oct 31 '21 at 08:41
  • Gitolite can absolutely work over HTTPS, although you may initially need to set it up over SSH. I have it set up myself over HTTPS. Those other options will work, but they probably will not autocreate repositories for you like you want. – bk2204 Oct 31 '21 at 14:42
  • I installed gitlab on my server and while that was not an easy task, it seems to work quite well. I can create a project in the web-interface and then access via https. And it does much more, that I need to explore. – Ingo Nov 01 '21 at 17:25
  • But, from the many answers I got, this is definitely the closes, so I will accept it. – Ingo Nov 01 '21 at 17:26