On Thu, Jan 17, 2013 at 11:36:14AM -0800, python.pro...@gmail.com wrote: > 1. I am trying to apply a commit which was done a while back on the HEAD. > > git log --oneline shows the following and lets say I want to apply the > commit 2618b13 on the HEAD. > 2617b13 > 2614b13 > 2611b13 > 2618b13 > 2618b13 --> I want to apply this change on the HEAD > > I am trying the following command but > 1.git format-patch 2618b13f479b45f49ee08ffb2203d875882dea3e^.. > 2618b13f479b45f49ee08ffb2203d875882dea3e > creates a patch cleanly > > 2.Now I want to apply this patch am using patch -p1 > 0001-Update-Android.mk-to-only-support-Open-Source-builds.patch,it gets > stuck > > How to proceed..are there any other options to do the above?
Yes, this is `git cherry-pick 2618b13`. But note that if your `git log --oneline` was made against the HEAD (you did not tell us), then it seems you're doing it wrong: if you want to apply a commit recorded on a branch *again,* this means the changes it introduced have been effectively cancelled by other commit(s) recorded later. If this is the case, you should better use `git revert` to undo those commits rather than re-introduce already existing commit and create confusion for someone who will later read this. --