Domanda

I'm going to start working on a web application. The application uses php and the files are going to be hosted on a server I own. Some of my friends will also be working on this project with me.

How exactly should I set up git (using GitHub) so that when me and my friends push our changes to GitHub, our server gets updated automatically with the php files?

È stato utile?

Soluzione

git push has a mirror mode that may just be what you want. All you need to do to activate it is to set your remote as --mirror=push and all should be good. IF not, leave a comment and I'll help further.

Altri suggerimenti

Another way is to install git on your server, add the settings for github and setup a cron every x period (1 minute) that makes a git fetch and reset to the development branch - that way when you push something to that branch your server will fetch it and reset the filesystem to it.

3rd way - check out the article using Github WebHooks on http://jonathanstark.com/blog/deploying-code-automatically-with-github-webhooks

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top