Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu automatically pull from Github repo

I installed git on my server but I want it to pull from my github repo whenever I push the changes I made locally.

I've looked into hooks but it's very confusing and I can't find any tutorials. Does anyone know how to do that?

like image 560
Sosa Avatar asked Jul 02 '15 03:07

Sosa


2 Answers

I want my server to pull from the repo after each commit

That looks like a webhook: your server would listen to a pull event (JSON payload) emitted by GitHub.

You will find many example of listener, like zenhacks/github-webhook-listener in CoffeeScript.

like image 171
VonC Avatar answered Sep 18 '22 18:09

VonC


Instead of having it automatically pull from Github, I just made a repository on my own server following this guide. How To Set Up Automatic Deployment with Git with a VPS

What this does is make it so that whenever i'm finished working on my site locally i'll push the repo on my server. Everytime the server gets a repo change it will checkout to my website directory.

I can also set up my local computer to push to Github at the same time, too. Very helpful guide I recommend it.

like image 45
Sosa Avatar answered Sep 20 '22 18:09

Sosa