6

I have installed gitlab on a vps server which is also my remote for committing my local changes.

When i commit and push to the server (git@domain.com:root/project.git), the code will be updated.

On my vps i have this workflow:

- var/www/
    - project (created through git clone git@domain.com:root/project.git)
        - Files within the project

When i do a push to the server, i want to let the server automatic pull the changes from gitlab. I also did a try with post-update hooks, but that doesn't work.

Do i have to create a bare repo ? Or did i forget something?

Daniel Hilgarth
  • 171,043
  • 40
  • 335
  • 443
Matt Dice
  • 317
  • 2
  • 5
  • 14

1 Answers1

5

project.git is a bare repo, so if you have access to the gitlab server, you can go to ~git/repositories/root/project.git/hooks and add your post-receive hook in order to force a deployment.

See an example in "deploying a website/webapp via git/gitolite permissions error" for instance.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250