I just stumbled across this gem from reinh.com. Git is amazingly powerful, but it doesn't enforce a workflow. That means a team has to come up with some rules on their own to give meaning to the tool.
He describes feature branches well, and takes it further than I have before. For example, he suggests always squashing little commits together before pushing.
Once work on the feature is complete, you will have a branch with a lot of small commits like “adding a model and a migration”, “adding a controller and some views”, “oh crap – adding tests” and so on. This is useful while developing but larger, incremental commits are more easier to maintain. We will use an interactive rebase3 to squash them together. Also, squashing these commits together will allow us to pretend that we wrote the tests first…
Or the same thing about bugs.
With a bugfix, squash the commits down into one and exactly one commit that completely represents that bugfix. Half of a bugfix is useless.
He also covers QA branch management and production tagging. One thing that confirms my latest work is the goal to get close to deploying straight from the latest "green" build, or the latest commit that makes it through the CI server.
