I just started using Git recently and I was reading up on Git best practices and it seems the most common one is to never work out of your master branch, always create a separate branch and work out of that. I’m wondering if this is only true when working with other developers or if this is something I should be doing if I’m the only developer on the project. If so, why? And how often should I merge the new branch? Why is that any different than just working out of the master branch and committing changes when necessary?
Thanks so much for your wisdom!
Working out of a branch maybe a good idea if – for example – you are adding a phat new feature which wont be ready for a few weeks. Whilst you are working on your new feature, the Live app cocks up. What do you do if you havent branched (or tagged) from trunk (in this case the code branch supporting live) ? you have to revert all your work and maintain copies of your changes, ready to slap them back in when you have resolved your live issue, bad times…