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:
- Looking up the SHA1 of the original commit
- Checking out the destination branch
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]