[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to move Git commit to some branch?



On Fri, Jun 11, 2010 at 11:02:56AM -0500, Boyd Stephen Smith Jr. wrote:
> On Thursday 10 June 2010 21:21:50 Joel Roth wrote:
> > On Fri, Jun 11, 2010 at 03:25:07AM +0300, Alexander Batischev wrote:
> > > I did a commit lately but figured out that it was made in wrong place - I
> > > was browsing previous commits at the moment, so now my new commit is
> > > somewhere in the middle of the history. I have its hash and I want to
> > > move it so it would be 'son' of last commit in the master branch. Which
> > > command should I use?
> > 
> > git-checkout master
> > git-cherry-pick <commit>
> 
> That's one way, I prefer something like:
> git checkout <commit>
> git rebase --onto master 'HEAD^'

That one looks more clear (for me), yet I already done a job with Joel's
command. Thank you for your variant, anyways!

-- 
Regards,
Alexander Batischev

1024D/69093C81
F870 A381 B5F5 D2A1 1B35  4D63 A1A7 1C77 6909 3C81

Attachment: signature.asc
Description: Digital signature


Reply to: