Gentoo Archives: gentoo-scm

From: Arun Raghavan <ford_prefect@g.o>
To: gentoo-scm@l.g.o
Subject: Re: [gentoo-scm] Converting a recent CVS copy - Item 3: pushing, availability
Date: Sat, 18 Apr 2009 05:07:25
Message-Id: 1240031014.16949.9.camel@peripatetic.hades
In Reply to: Re: [gentoo-scm] Converting a recent CVS copy - Item 3: pushing, availability by William Hubbs
1 On Fri, 2009-04-17 at 22:54 -0500, William Hubbs wrote:
2 [...]
3 > Here is my understanding of what rebase does. Say that I'm working on
4 > the master branch, and I do a commit, but someone else is also working
5 > on the master branch at the same time. They do a commit and push
6 > before I do my push.
7 >
8 > Now I try to push. Git will complain because my master branch is not up
9 > to date. If I do a git pull without --rebase at this point, I will
10 > create a merge in the history. But, if I do a git pull --rebase, my
11 > local change, which has not been pushed yet, will be moved forward so
12 > that it happens after all of the changes I pull. If there are
13 > conflicts, I resolve them on my end. then continue the rebase process
14 > until it is done. Then I do a git push to push my change to the central
15 > repository.
16 >
17 > My only question about this would be, what would happen if I do not
18 > resolve the conflicts correctly locally.
19
20 Just to expand on this, what happens is this. Assume the timelines of
21 the remote and local branches look like this:
22
23 remote: 1 -- 2 -- 3 -- 4 -- 5
24 local: 1 -- 2 -- 3 -- a -- b ('a' and 'b' are local commits)
25
26 You last sync'ed your tree at version '3', and want to rebase, so the
27 tree looks like:
28
29 local: 1 -- 2 --3 --4 -- 5 -- a -- b
30
31 What 'git rebase' does is that it rewinds the local tree back to '3',
32 pulls in revisions '4' and '5', then applies each local commit on this
33 tree. As each 'patch' is applied, if there is a conflict, the rebase
34 pauses and lets you resolve the conflict (you fix conflicting files and
35 then 'git add' them), and then you can tell git to continue the rebase.
36
37 In this sense, if you do not resolve a conflict correctly, it is about
38 the same as not resolving a conflict correctly during a 'git pull' --
39 your tree will be broken (or at least incorrect).
40
41 Hope this makes sense.
42
43 Cheers,
44 Arun

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-scm] Converting a recent CVS copy - Item 3: pushing, availability Maciej Mrozowski <reavertm@××××××.fm>