Branches
Creating a new branch
Editing a branch
-
Isolated Development : Each branch serves as an isolated environment for a specific feature or fix. This separation means that developers can work on their tasks without impacting the work of others. -
Easier Collaboration and Coordination : When each developer works on their branch, it reduces the need for constant communication and coordination that would be necessary if everyone were editing the same branch. This setup streamlines the development process and minimizes disruptions. -
Stability of the Live Branch : The live branch (or 'trunk' of the tree) remains stable, as it only contains completed and tested features. -
Simplified Testing and Debugging : Testing and debugging become more manageable when changes are isolated in separate branches. Developers can test their changes independently before publishing them, reducing the likelihood of introducing bugs. -
Reduced Risk of Conflicts : Separate branches reduce the risk of conflicts that can arise from simultaneous edits to the same part of the code in a single branch.
Merging a branch
Tip: Keep branches small and short-lived. Ultimately, a branch should contain just a single feature like "add-color-picker" or "fix-dialog-styling-issue". If the feature is too large, try to divide it up in smaller parts so that each branch can be closed within a single days work. This will help you iterate faster, avoid merge-conflicts, easier reverts and to better keep track of changes.
Conflicts
Previewing a branch
Time travel