Merge Individual Commits with Git Cherry Pick

I had the problem today of moving some code over to another branch today. I couldn’t just ┬ámerge these branches together as other features in this branch weren’t ready to be moved into my main branch, so I learned how to use the git cherry-pick to pull over only the commits I needed.

Here is my current master branch log:

Here are some changes I have made in my v2 branch:

I want to move two commits into master without moving the navigation commit:

  • The font change 0574d9c85d17e22ea9e5c0c938700880e4e0550f
  • The text styles 77b3d49e7d9894db059375c8267fdfb447cb7a7c

It’s as simple as running:

  • git cherry-pick 0574d9c85d17e22ea9e5c0c938700880e4e0550f
  • git cherry-pick 77b3d49e7d9894db059375c8267fdfb447cb7a7c

Now if we take a look at out Git Log, we can see that these two commits have been moved across, leaving the unwanted commit in the branch. Yay!

Hub for Git

Hub for Git is a great little tool for extending Git. It acts as a CLI tool for Github allowing easy cloning, commiting, pushing and my favourite feature: Repository Creation.

By adding alias git='hub' to your terminal profile you can effectivly extend Git. Hub falls back to standard Git commands, so you can continue to use Git as normal.

git create -d "My description" will create a repo with the current directory name and the description you provide. I think that’s awesome.
Check out Hub at http://hub.github.com/

Cleaning Out My Space on the Web

Lets face it, we all have far too many online account, most of which we don’t even use. I’ve been keen to clean up my disused profiles for some time now, but I really have no idea where to start. There are so damn many of them.

This weekends project is to write a RubyGem that scans the net and notifies me of possible profiles I may have. I’ll probably implement it based on searching my username on Google and then using Nokogiri to parse the results.

See you on the other side!

Edit: It was easier just to use Google.