In early 2010, Vincent Driessen wrote an article called “A successful Git branching model” which recommended an approach called git-flow to use git branches in your development cycle.
The idea was to standardise branching and merging when developing features, handling releases and managing hot fixes, in order to be consistent and gain the advantages of git’s ‘branchy’ development model.
There’s a handy new addition to the toolbar in Source Tree 1.5 (keyboard shortcut Cmd-Alt-F): Based on the current state of the repository, the Git-flow button will bring up a dialog with the most likely action you’d want to perform next.
So if you haven’t set up git-flow on this repo yet, it’ll help you do that by default.
If you’re on the development branch, it will default to starting a new feature.
If you’re already on a feature branch, it will offer to finish your current feature and merge it back into the development branch, and so on.
You can always get to all the other git-flow actions via this button as well, but most of the time the default option will be the action you’ll want Source Tree to perform.
If you haven’t used git-flow already on this repository, the first thing Source Tree will do is initialise your repository to use it.
You’ll probably just want to use the defaults in the initialisation window so that’s not covered here.
For more details please see the Help section included in Source Tree.
Next up, we’ll concentrate on the actions we can perform with Git-flow and Source Tree.
You can commit trivial changes directly to the development branch (‘develop’) if you like, but any time you start on something non-trivial you should explicitly start a new feature.
This ‘Start Feature’ action will be the default action when you click the Git-flow button if you are currently on the dev branch.