Re: Picking up multiple cherries at one go.
- From
Alex Riesen <raa.lkml@gmail.com>
- Date
- Mar 24, 2010, 09:21 UTC
- Message-ID
- <81b0412b1003240221o53196568r9c8f2e0b7a2f1fd7@mail.gmail.com>
- In-Reply-To
- <ffef8f9a1003240147o777d058jfacd79aa86908925@mail.gmail.com>
On Wed, Mar 24, 2010 at 09:47, Jozef Babjak <jozef.babjak@gmail.com> wrote:
Show 8 quoted lines
> However, last days I needed to split a long multi-purpose branch into > several topic branches. The branch was created as a result of 'general > cleanup and refactoring', but at the end of day I realized that some > well-defined parts can be identified there and so I wanted to extract > them to dedicated branches. Thus, cherry-pick and rebase were my > friend for couple of days. Everything goes well, but there was a > repetitive task - cherry picking multiple commits. Sometimes the > process failed, because cherry picking led to conflicts. ...
Try git rebase -i (interactive) next time. It does not exactly what your script does, but ... You may like it.
> To simplify this task, I wrote the shell script attached at the end of this > email.The script named git_cherries.sh reads commit IDs from stdin and > cherry-picks those commits to current branch. Everything is done on an > auxilliary branch, ...
You can commit without a branch (called "detached HEAD"). Try "git checkout HEAD^0", for example. No need to invent new branch names (and risk collisions).