Learning git made me a better svn user

Before learning git, I rarely created branches in svn projects. Honestly, I don’t know why. It seemed like too much work, but really that was just because I didn’t do it. Now, whenever I start a new feature, I create a branch first.

svn cp {{trunk}} {{branches/blah}}

Sure, it creates a branch on the svn server that may or may not go anywhere, but it’s simple to remove it, so there’s no harm. It also feels a lot safer. Even my experimental code lives on both my system and on the repository server. My commits are getting smaller and more focused as well. Previously, I would often wait until a whole feature was complete before committing. Now, I commit each individual step.

When I’m done, it’s simple to merge back in.

svn merge -r{{start_rev}}:{{end_rev}} {{branches/blah}}

But what about conflicts, right? Git handles merging much better, but again, it’s an unfounded fear. Yes, if changes are made to trunk while you are working on the branch, you might get conflicts, but in my experience, conflicts are rare and the benefits of branching outweigh the risk.