* Git rebase aggravation
@ 2009-02-23 4:20 Myxz Ptlk
2009-02-23 4:34 ` Nazri Ramliy
2009-02-23 9:34 ` Thomas Rast
0 siblings, 2 replies; 3+ messages in thread
From: Myxz Ptlk @ 2009-02-23 4:20 UTC (permalink / raw)
To: git
I have two branches that diverged a long time ago, master and zoo. I work
locally and check changes into a remote repository. The remote repository
is also set up the same, and the local branches are set up to track the
remote branches. Major development has gone on in both sides unfortunately.
"master" is the production version. My strategy to get the two together
was:
1) Rebase master into zoo.
2) Merge zoo into master.
But here is what happens. I spend 3 hours inside "zoo" doing "git rebase
master". I go through all the hell of reconciling 6 months of development.
Then at the end, it just says that the commits now differ between local
"zoo" and "origin/zoo".
So I figure, I will pull from "origin/zoo". Naturally, that results in a
conflicted merge, which I then clear up. I commit the merge, then push
everything back to the remote branch.
Now I would guess that my "zoo" branch has everything in it from "master",
and it is also in sync with the "origin/zoo" branch. I push and pull and
verify that this is so.
My thinking is that if I were to attempt a new rebase of master, the
beginning of what would be rebased would start from RIGHT NOW, instead of
all the commits over the past 6 months. To check this, I type:
git rebase master
from "zoo". Lo and behold, it starts the whole process over again. I "git
rebase --abort", but I am very, very confused.
Why does the rebase not remember all the freaking work I just did? Why
would I have to rebase the same commits all over again? How do people keep
downstream branches up to date if this doesn't work? What am I missing
here? I will be extremely grateful for any help and understanding anybody
can offer.
--
View this message in context: http://www.nabble.com/Git-rebase-aggravation-tp22155203p22155203.html
Sent from the git mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Git rebase aggravation
2009-02-23 4:20 Git rebase aggravation Myxz Ptlk
@ 2009-02-23 4:34 ` Nazri Ramliy
2009-02-23 9:34 ` Thomas Rast
1 sibling, 0 replies; 3+ messages in thread
From: Nazri Ramliy @ 2009-02-23 4:34 UTC (permalink / raw)
To: git
See git help rerere.
It's not enabled by default.
nazri.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Git rebase aggravation
2009-02-23 4:20 Git rebase aggravation Myxz Ptlk
2009-02-23 4:34 ` Nazri Ramliy
@ 2009-02-23 9:34 ` Thomas Rast
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Rast @ 2009-02-23 9:34 UTC (permalink / raw)
To: Myxz Ptlk; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 2406 bytes --]
Myxz Ptlk wrote:
> 1) Rebase master into zoo.
>
> 2) Merge zoo into master.
You may want to consider a merge and topic branch based workflow. man
gitworkflows has some pointers.
For the rest of the discussion let's assume that your history looks
like
*---*---*---* (master)
\
\
o---o---o (zoo = origin/zoo)
Since you have tracking branches, origin/zoo should be the same as
zoo. (origin/master should exist too but isn't important for now.)
> But here is what happens. I spend 3 hours inside "zoo" doing "git rebase
> master". I go through all the hell of reconciling 6 months of development.
> Then at the end, it just says that the commits now differ between local
> "zoo" and "origin/zoo".
Indeed, since you rewrote every commit on zoo, it now looks like
*---*---*---* (master)
| \
| \
\ o'--o'--o' (zoo)
\
o---o---o (origin/zoo)
> So I figure, I will pull from "origin/zoo". Naturally, that results in a
> conflicted merge, which I then clear up. I commit the merge, then push
> everything back to the remote branch.
You're merging like this:
*---*---*---* (master)
| \
| \
\ o'--o'--o'---M (zoo)
\ /
o---o---o---------------'
(origin/zoo)
I think you can already see that you made a mess of history :-)
You should have forced the push instead. But see "recovering from
upstream rebase" in man git-rebase for information on what happens to
everyone else's work that was based on zoo.
> My thinking is that if I were to attempt a new rebase of master, the
> beginning of what would be rebased would start from RIGHT NOW, instead of
> all the commits over the past 6 months. To check this, I type:
>
> git rebase master
>
> from "zoo". Lo and behold, it starts the whole process over again. I "git
> rebase --abort", but I am very, very confused.
Actually it's even worse: it should attempt to rebase _every_ commit
in master..zoo. If master has progressed since your original
rebase+merge, this will be both the "o" and "o'" commits above.
(Except the ones that did not conflict at all, since they'll still be
the same.)
--
Thomas Rast
trast@{inf,student}.ethz.ch
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-02-23 9:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-23 4:20 Git rebase aggravation Myxz Ptlk
2009-02-23 4:34 ` Nazri Ramliy
2009-02-23 9:34 ` Thomas Rast
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).