We have a team of a few developers and want to begin using feature branches in git so that we can collaborate on certain tasks in a vacuum. The problem is that we have servers which check out very specific branches - integration, stage, production. If code is on a feature branch, there is no way we can push it to some central server where everyone in the company (including non-developers) can use & preview it. I thought about developing some script that would let a developer specify a branch name which an "anything goes" server would check out, that way there's always one server that could be running any given branch, for previewing purposes. But that seems kind of clunky/suboptimal. I was wondering if anybody else has done something similar before, and if so, if there's a better way of going about it?
2 Answers
These sorts of things are usually cooked up to the taste of the company you're working with/for. There's no set answer per-se, but with what you're describing, I think you could do one of two fairly easy things:
1) Maintain a 'preview' branch where your devs merge into very regularly, is known to be not quite stable (but pretty good), and have a server (internal or external) constantly updated with the latest preview branch.
2) If you want the feature branches more atomic, you could have your devs keep two copies of the source. One for working on, one for hosting their own 'preview' work. The preview work is the more stable, not-being-edited-at-this-second repo. Then, on your internal network, map your dev's names on the network (e.g. http://bryce.local) for everyone in the company to preview. When a feature is ready to be previewed, send an email to the company saying something like: "the super cool feature is available at http://bryce.local."
Workflow is a pretty personal subject in git and there are lots of ways to go about it. Add comments and I can help tailor this approach better.

- 4,343
- 3
- 26
- 29
Your problem is only very vaguely described. If this is only a development server without external visibility you could do the following:
- create a new repository on another location and set it up as remote tracking branch this
- install a git hook (server side) just as the git-book describes.
The git hook should either force the server to pull or forward pushes to the server. you need to make sure that the development server automatically deploys the application then.
you can choose any method you like starting from jabber, email, rss or just a simple ssh access.
The easiest is probably ssh access method:
- running remote scripts via ssh. see other stackoverflow questions
- accessing ssh remote accounts via scripts or prgramming languages: like this
with these building blocks you should be able to tailor the automatic deployment. Actually even google gives plenty of hits how to do automatic deployment

- 1
- 1

- 24,223
- 14
- 73
- 76