Git is one of the leading distributed version control systems. Originally developed by Linus Torvalds to manage the source code of the Linux kernel, it has achieved widespread popularity in the Ruby community.
Git's recent rise to fame is no doubt due in some small part to the success of github, a Git hosting solution, repository browser and social network all rolled into one. It's also a great way to keep tabs on other work that is occurring within the community.
You can browse several of Effectif's open source projects on my github page.
When starting to use Git on a new computer there are several steps that I always take before I start work. They make life a little easier when working with Git in a terminal.
When a bug has crept in to your code that you're having trouble fixing, it helps to know when it was introduced. If you can prove which code caused the bug you can normally work out why. The
git bisectcommand is here to help you track it down...
Have you ever made a few commits on a branch, only to later realise that you should have been working on a topic branch (i.e. a branch specific to the task you're working on)? So long as you haven't yet shared any of these commits with anybody else, you can easily move them on to a new branch, and then remove them from your current branch.
Applying GitHub pull requests can be very easy if the patch is obviously good -- you just click the green "Merge pull request" button and get on with your day. If you need to get the code into a local repository before you can push it up to your project's master branch (as I always do) things are a little more involved. But we can speed the process up...
I found myself wanting to swap the names of two files in my Git repository, and couldn't find an easy way to do it with the
gitcommand. So I extended it. Now I just type
git swap file1 file2to rename the two files to each other.
Does your version of
gitklook like Windows 95's ugly step sister? Would you rather it used native buttons and widgets, and a half decent font?
I've been trying to persuade
git-svnto work properly with Rails plugins that are installed via
svn:externals. Whilst working out how to do it I stumbled across several great articles, but I couldn't get any of the solutions presented to work perfectly.
After a bit of head scratching I got it sorted, and wrapped the process up in a little utility called git-me-up.
When I first setup this blog I took the opportunity to try out Git, and imported the source of the blogging software into a Git repository. The thinking was that if I needed to patch the blog software that I'd have a fairly trouble free upgrade path, merging the upstream changes straight into my branch.
All went well until, after several hours of work, I lost everything...