git love

I'm crawling out of the rock I've been hiding under for the last months to write my first post here and to (again) proclaim the huge grand-ness of git.

My use case today: A week ago I fixed a rather small bug in a branch that has not been merged into master. Today I stumbled over the same bug in another branch and of course remembered that I fixed the problem already.


git co master
git log -Sinit_job   # gives me a306cfc = the commit that fixed the bug
git co the-branch-I'm-currently-working-on
git cherry-pick a306cfc


And now I have to go back to not spend time on the lovely Perl community...

1 Comment

With recent versions of git you can easily switch between branches your current branch and your previous branch with git cd -; just cd - does with folders.

Leave a comment

About domm

user-pic Just in case you like to know, I'm currently full-time father of 2 kids, half-time Perl hacker, sort-of DJ, bicyclist, no longer dreadlocked and more than 34 years old but too lazy to update my profile once a year. I'm also head of, no longer maintainer of the CPANTS project, member of the TPF Grants Commitee and the YAPC Europe Foundation. I've got stuff on CPAN, held various talks and organise the Austrian Perl Workshops and YAPC::Europe 2007.