Skip to content

Instantly share code, notes, and snippets.

View L96Github's full-sized avatar

Luis Rita L96Github

  • Appy People
View GitHub Profile
@odrotbohm
odrotbohm / gist:3215345
Created July 31, 2012 09:08
Git aliases to ease cherry picking

When fixing bugs on a software project I repeatedly faced the situation where I'd like to apply the commit I just did to a branch to another. Think of fixing a bug in the master branch and immediately back-porting it to the maintenance branch. This usually needed the following steps:

  1. Looking up the SHA1 of the original commit
  2. Checking out the destination branch
  3. git cherry-pick $sha1

The very first step can be eased a bit by creating a git alias to lookup the SHA1 of the last commit of a given branch.

[alias]