Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anyone provide a rough outline of their git workflow that complies with continuous integration.
E.g. How do you branch? Do you fast forward commits to the master branch?

I am primarily working with Rails as well as client and server side Javascript. If anyone can recommend a solid CI technology that's compatible with those, that'd be great. I've looked into Jenkins but would like to check out other good alternatives.

To put some context into this, I am planning on transitioning from working as a single developer into working as part of the team. I'd like to start standardizing my own personal workflow so that I can onboard new devs quickly.

share|improve this question
Did you look how this is done commonly? Set up e.g. jenkins with gerrit and play with it. – Benjamin Bannier Mar 24 '12 at 8:57
Have you tried something that didn't work or didn't seem right, that you could describe & add to your question? – jcmeloni Mar 24 '12 at 12:03
up vote 10 down vote accepted

A simple workflow.

  1. Central Git Repo used by the CI server
  2. People push to a specific branch on that Repo (say Master)
  3. CI Server detects changes in master branch or runs a timed build
  4. CI Server runs unit tests
  5. Depending on your rules, the CI server can then tag the repository, and a myriad of other things.

There are countless ways to do this, do what fits your workflow the best.

share|improve this answer
Do you use feature branches? How do you ensure a clean commit history on the master branch? Or are everyone's commits aggregated? – Andrew Lauer Barinov Mar 28 '12 at 23:55
We do not use feature branches to trigger builds, but we do use them. We don't worry that much about clean commit history, we'd prefer it was accurate – sylvanaar Mar 29 '12 at 14:13
  • Work
  • Commit to your local repo
  • Push (to master repo)
  • CI detects new revision
  • CI checks out new revision
  • CI builds and tests new revision
  • CI updates Changelog (commit and push)
  • CI creates a version file and then tags master repo
  • CI packages build
  • CI pushes package to artifact repo (in our case a YUM repo)
  • rinse, repeat

We don't work of branches. We always commit to trunk, but then again we also do ATDD to mitigate the common issues like instability.

share|improve this answer
Is the CI server you're using a custom one or something that's available off the shelf? – Andrew Lauer Barinov Mar 28 '12 at 23:44
@Andrew Barinov: We are currently using Hudson, but most of the logic is in our Makefiles. – dietbuddha Mar 29 '12 at 5:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.