Fork me on GitHub

When to Branch

When to Branch

So i’m learning about source code version control, with Git. This explains the art of when to create a branch. More so for my furture reference:

  • Experimental changes: Want to try rewriting algorithms just to see whether they’re faster, or want to try refactoring a section of code to a particular pattern? Create a new branch to do your work in, and you can work on it separately from any changes that are being deployed immediately.
  • New features: Every time you start working on a new feature, create a new branch. You can merge it back in as soon as you’re done, either with the full history or through a squashed commit.
  • Bug fixes: Whether it’s a fix to a bug in code that hasn’t been released or code that has already been tagged for a release, you can create a branch to track your changes to that bug. This gives you a lot of flexibility in how you merge it back into the rest of the code, just like creating a branch for a new feature. This is especially true if your bug fix is going to take some experimentation.

Posted by voidet

Categorised under Software
Bookmark the permalink or leave a trackback.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

or