Re: Proper way to abort incorrect cherry-picking?
- From
- Eugene Sajine <euguess@gmail.com>
- Date
- Apr 28, 2010, 19:59 UTC
- Message-ID
- <h2v76c5b8581004281259yfaca7abfz5a455ff8fd6cdc6b@mail.gmail.com>
- In-Reply-To
- <r2s302ed1461004281249xd1b65e41l43fa7b639db7c97d@mail.gmail.com>
On Wed, Apr 28, 2010 at 3:49 PM, David Borowitz <dborowitz@google.com> wrote:
Show 21 quoted lines
> On Wed, Apr 28, 2010 at 12:38, Eugene Sajine <euguess@gmail.com> wrote:
>>
>> hi,
>>
>> we have tried to cherry-pick 2 commits from one branch to another
>> branch, but unfortunately the incorrect commit was chosen to be
>> applied first.
>>
>> Thus, the automatic cherry-pick failed and caused conflicts, so in
>> order to to cancel the whole operation i had to do the following:
>>
>> 1. mark the conflicting files as resolved (without even resolving
>> them) by doing git add.
>> 2. unstage all files staged for commit as a result of incomplete cherry picking
>> 3. manually checkout touched files to their correct state (git checkout file)
>>
>> and then i was able to repeat cherry-picking with correct commits.
>>
>> Is there a better way?
>
> git reset --hard HEAD@{1}?not always working. In our particular case there were some local modifications to other files, which would be blown away with this for no reason. That's why I went the long way of resetting specific files.
Thanks, Eugene