It seems like git has been picking up more and more traction in the web community, and tools like Tower and gitx seem to be making git tons more accessible to designers. One of my favorite features of git is how easy it makes branching. Most of the time that I work on a new feature I create a branch for it in my git repo, and I typically push that branch up to the server if it’s going to be around for more than a few hours. The commands for doing all of that can be hard to remember, though. Enter grb, short for git_remote_branch.
grb is a command line tool that makes creating remote branches both locally and on the server really easy. For example, to create a remote branch you’d typically have to create the new remote branch, fetch, make sure that no remote branch with the name you’d like to use already exists, create a new tracking branch, and then check out the new tracking branch. That looks something like:
1 2 3 4
> git push origin master:refs/heads/new_branch > git fetch origin > git branch --track testing origin/new_branch > git checkout testing
But with grb this is as easy as:
> grb new new_branch
To remove a remote branch just run:
> grb rm new_branch
grb includes features for creating, removing, and renaming remote branches, as well as for pulling and tracking remote branches. It’s a tool I’ve been using for over a year now, and has been invaluable in my toolkit. It’s a piece of cake to install, too. Just make sure you have Ruby available and run:
> gem install git_remote_branch
On any modern Mac Ruby came preinstalled and on Windows it’s easy to install Ruby with the Ruby Windows Installer. You’ll want the gem command around anyway because tons of web projects like SASS are delivering their tools through RubyGems.
What tools are you using to help out with your version control workflow?