3

I've got the actual code in public facing dir under one user. It's in /home/user1/public_html/dev

And for gitosis I had to set another user Git, and gitosis wants it's repos in "/home/git/repositories/"

So, from what I read best and easiest is to just symbolink link them. But which dir to which?

When I create new "test" project locally I have .git sub-folder in the "test" folder, but when push it in "/home/git/repositories/" it creates test.git folder on the remote server with the contents of the local .git folder, but I don't see the actual files?

So, i'm a bit confused how this works and what I should link. Please note this my first time with git, gitosis and all this, so i'm probably asking something quite stupid but i'm really blocked at this point.

Billal Begueradj
  • 20,717
  • 43
  • 112
  • 130
user240891
  • 31
  • 2

1 Answers1

0

gitosis (which is obsolete for a few years now: gitolite is much richer) works with bare repos: repos without a working tree.

And /home/user1/public_html/dev is a repo with a working tree.

So you don't (sym)link both together. Not directly.

You can (for instance) set up a post-receive hook (in the bare repo) in order to go to the non-bare repo and pull: see "Gitosis post-receive hook to deploy repository getting public key errors".
You have a much more complete hook script in this blog post.

But the point is: both repos are independent, and acting on one (pushing to a bare repo) will have an effect on the other through a hook.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Hey, just started looking into it. Seems like gitolite also has it's own dir to store the repos? Is sm linking easier there though? Or I shoud look into other options. Infact I need to provide secure access to just 1 person right now. But will prefer he doesn't have shell access. – user240891 Sep 02 '14 at 12:12
  • "But will prefer he doesn't have shell access" that is exactly what gitolite does. – VonC Jun 24 '17 at 07:23