September 1, 2015

Nail Down Your Branching Strategy for Success with Git in the Enterprise

What's New
Branching
Git at Scale

(Part 1 of a 7­-part series)

Git’s popularity for open­-source and other small­- to medium­-size projects has led inexorably to the enterprise, but making Git work in that arena is neither easy nor obvious. In fact, its adoption creates a number of challenges to balance developer preference with the needs of the enterprise. In this 7-­part blog series, we will review some of the challenges faced when using Git in the enterprise space and recommend best practices for successfully managing the task.

Workflow

The most obvious reason for Git adoption is because developers like its distributed workflow (even though it’s rarely used in an entirely distributed mode). They often need to switch contexts frequently, and Git’s support for lightweight, in­place, local branching is a big help. In fact, Git’s branching may be its defining feature.

But once you move beyond the individual desktop, the key issue arises of how to manage all the new complexity. Who gets to determine the final, release branching structure? What is the protocol for sharing experimental branches with colleagues? Where should the work be reviewed? When should those branches’ contents be brought back into the master? And how should that be done, given that the Git community remains polarized over merge versus rebase.

One approach is provided by the Git­flow proposal, although it’s not an ideal solution for all teams. Tools like GitSwarm, GitHub, GitLab, or Atlassian Stash implement simple workflows around pull requests to supply some of the answers. The best time to address these issues is before teams start adopting Git because trying to change workflows and rebuild history once work has been committed is, at best, a very messy business.

Workflow Best Practices

  • Nail down your branching strategy with clear stages and triggers, preferably automating the flow of code as much as possible.
  • Make review an integral part of that branching strategy; multi­disciplinary collaboration is crucial to modern product development.
  • Give all of your stakeholders tools suited to their particular needs to maximize productivity and ease of use.

Keep Reading

In the next installment in this series, we’ll tackle the issue of content management and asset storage. For the complete set of Git in the Enterprise tips and best practices, download our free eBook here.