2

I know how to bind a domain/subdomain to a directory using apache, through virtualhost. I would like to do the same operation without using apache and http. Something that can work using ssh or git protocol. I can't find any data on the internet.

Especially, on github, to clone a repository, you can use "git@github.com:symfony/symfony.git", I'm pretty sure that users managing repositories aren't stored at / .

Any ideas ? Thanks.

Alex Ception
  • 214
  • 3
  • 12

1 Answers1

1

The way it can work with ssh is when you are using the ssh forced command mechanism which will call a script with:

  • your git command (clone, push, pull)
  • your repo name (deduced from the git command)

That script knows where the repos are.

One example of such an approach is done with gitolite (see how does gitolite works).
The .gitolite.rc it generates during its installation will put all the bare rpeos at ~/repositories:

$rc{GL_REPO_BASE} = "$ENV{HOME}/repositories";

Yet, with the appropriate ~/.ssh/config file on the client side, you would clone a gitolite repo with:

git clone gitolite:myrepo

More details at "users are asked for password while using gitolite".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you for that quick answer. Obviously, I saw this kind of answer browing the internet. But the forced command was for sftp, i thought this was irrelevant for my case. Anyway, thank you, I'll study that right now. – Alex Ception Jan 19 '13 at 12:31
  • @pataprout I have edited the answer with more details on gitolite. You can see my installation script for gitolite at https://github.com/VonC/compileEverything/blob/master/gitolite/install_or_update_gitolite.sh – VonC Jan 19 '13 at 12:31