Can I set up my server to automatically pull updates from a branch when new commits come in?

StackOverflow https://stackoverflow.com/questions/9912107

문제

Say I have a project in a git repository. The project has a branch called "Stable" or "Production" where the current version of the project is always stable. I have a production server that ideally should always have the most recent version of the stable branch. I know I could have a cron job run a pull at a specific interval, but I'm not really happy with that solution. Often I could push as much as 5 hotfixes in an hour after discovering a bug in the stable branch. I would like the production server to instantly pull those new commits once they have been pushed.

What would be the simplest way of doing this? My fallback solution will be to have my production server run a pull every minute or so, so anything short of that would be great.

도움이 되었습니까?

해결책

You could do post-commit hook which will push to the production server.

Also, the pulling every minute doesn't look as a bad solution.

다른 팁

If you have a build server(Bamboo, Hudson, Cruisecontrol, etc...), you can also setup tasks to trigger a pull in another branch when updates are detected in the source. We have tasks setup in Bamboo which do such using native git.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top