Re: User's mailing list? And multiple cherry pick

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David <wizzardx@...>
Cc: Jakub Narebski <jnareb@...>, <git@...>
Date: Wednesday, June 4, 2008 - 7:36 am

On Wed, Jun 04, 2008 at 10:11:33AM +0200, David wrote:


OK, so assume the tree looks like this:

 o--o--O master
        \
         1--2--3--4--5--6--7--8 topic

First do a "git checkout topic; git rebase --interactive master", and
reorder the topic branch so it looks like this:

 o--o--O master
        \
         3--4--5--6--1--2--7--8 topic

Now find the commit ID for commit #6 above, and assuming that it's
f1dead2f, run the command "git checkout master; git merge f1dead2f".
Now the graph looks like this:

 o--o--O--3--4--5--6 master
                    \
                     1--2--7--8 topic

You could also use the command:

	"git update-ref refs/heads/master f1dead2f"

which keeps HEAD pointing at the topic branch, but the reason why I
suggested the "git checkout master; git merge f1dead2f" is that the
commands are generally more familiar to git newcomers, and I usually
want to do a test build and run the regression tests on master to make
sure things are clean.



Note that in the above set of commands, summarized as:

1) "git checkout topic; git rebase --interactive master"
   1a)  "make; make check" to build and run regression tests on the 
   	reordered topic branch.
2) "git checkout master; git merge f1dead2f" (this should be a fast forward)
   2a)  "make; make check" to build and run regression tests on the 
   	updated master branch.

There may be indeed conflicts at the first "git rebase --interactive",
but that's just git being conservative.  Usually it really isnt that
hard to resolve the conflicts, git add the files which required
fixups, and then doing a "git rebase --continue".  And you will have
to do the manual fixup regardless of whether you use "git rebase" or
"git cherry-pick"; the git rebase is just a more automated way of
doing things.

Regards,

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: User's mailing list? And multiple cherry pick, Stephan Beyer, (Wed Jun 4, 4:00 am)
Re: User's mailing list? And multiple cherry pick, Jakub Narebski, (Wed Jun 4, 3:39 am)
Re: User's mailing list? And multiple cherry pick, Miklos Vajna, (Wed Jun 4, 7:10 am)
Re: User's mailing list? And multiple cherry pick, Theodore Tso, (Wed Jun 4, 7:36 am)
Re: User's mailing list? And multiple cherry pick, Jakub Narebski, (Wed Jun 4, 4:50 am)
Re: User's mailing list? And multiple cherry pick, Jakub Narebski, (Wed Jun 4, 5:47 am)
Re: User's mailing list? And multiple cherry pick, Junio C Hamano, (Wed Jun 4, 2:58 am)
Re: User's mailing list? And multiple cherry pick, Johan Herland, (Wed Jun 4, 4:16 am)
Re: User's mailing list? And multiple cherry pick, Jakub Narebski, (Wed Jun 4, 4:05 am)
Re: User's mailing list? And multiple cherry pick, Wincent Colaiuta, (Wed Jun 4, 5:39 am)
Re: User's mailing list? And multiple cherry pick, Jakub Narebski, (Wed Jun 4, 7:09 am)
Re: User's mailing list? And multiple cherry pick, Wincent Colaiuta, (Wed Jun 4, 7:02 am)
Re: User's mailing list? And multiple cherry pick, Johan Herland, (Wed Jun 4, 4:23 am)