Wednesday 7 July 2010

A simple developer process with Git

There seems to be quite a few questions about how to work with Git in a project because the whole concept of distributed version control is unclear. My proposal for the starting point for developers new to the concept looks like this (Gitorious is used here as the tool to host the central repository used to share the code):


The idea is to create a new branch for every feature the developer is working on. This helps the merge/rebase operations which in turn motivates the developers to do it often enough. An advanced concept would include quashing the commits with rebase --interactive just before releasing the code to the central repository. This blog post explains how to do it. This would help keep the commit log clean and simple. The feature branch is also a must in my opinion if this feature is used because it alters the history and you never, ever (*) do that to code that has already been released. If the developer works solely on the trunk of his repository, there is a greater risk that he does the rebase to already published code.

(*) See "Perils of Rebasing" in the excellent ProGit book.

No comments:

Post a Comment