From: Linus Torvalds <torvalds@osdl.org>
To: Marc Singer <elf@buici.com>
Cc: Git Mailing List <git@vger.kernel.org>, Junio C Hamano <junkio@cox.net>
Subject: Re: Effective difference between git-rebase and git-resolve
Date: Fri, 24 Mar 2006 20:23:04 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.64.0603242014160.15714@g5.osdl.org> (raw)
In-Reply-To: <20060325035423.GB31504@buici.com>
On Fri, 24 Mar 2006, Marc Singer wrote:
>
> The process I've been using to keep my patches current with the latest
> development is this:
>
> git checkout linus && git pull linus
> git checkout work
You'd be much more efficient if you just did
git fetch linus
which avoids switching back-and-forth (and speeds up the pull too, since
it doesn't need to update any working directories).
> When I'm ready to merge,
>
> git resolve work linus "Update with head"
No, don't do this.
"git resolve" is the _old_ stupid merger, which isn't very helpful at all.
So please use
git merge "Merge with Linus" work linus
instead, which will use the proper "recursive" merge functionality.
> Then, I found git-rebase which seems to be more what I'd like to use
> since it moves my patches along on top of the main development line.
>
> git rebase linus
>
> This time, almost everything merged without a hitch except for the
> thorny file from before. I edited the file, removing the conflict
> markers, and started a build. But what I found was that some of the
> changes I'd made were no longer present.
Yeah, "git rebase" is not _nearly_ as intuitive as doing a real merge.
What happened was that you resolved the thorny merge, but the rebase had
stopped when it hit it, so it never actually did the rest of the rebase.
Which explains why some of your changes are no longer present: they are
still in the "rebase queue".
> 1) Am I using rebase correctly?
Yes, but you missed the fact that unlike "git merge", rebasing really is a
"move one commit at a time" thing, and it stopped on the middle.
> 4) Should I prefer rebase over resolve?
You should never do "resolve", it's very oldfashioned. If you want to
merge, just use "git merge", which will do the right thing.
As to rebase, it often is very nice, but on the other hand, it leaves
things in a total mess when it fails, which is a pity. Maybe there's a
nice way to just continue, but I end up just doing a
git reset --hard ORIG_HEAD
to undo the failed rebase.
Junio, is there some magic to restart a rebase after you've fixed up the
conflicts?
Linus
next prev parent reply other threads:[~2006-03-25 4:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-25 3:54 Effective difference between git-rebase and git-resolve Marc Singer
2006-03-25 4:23 ` Linus Torvalds [this message]
2006-03-25 6:08 ` Junio C Hamano
2006-03-25 6:32 ` Marc Singer
2006-03-25 7:15 ` Junio C Hamano
2006-03-26 20:29 ` J. Bruce Fields
[not found] ` <20060325043507.GA14644@buici.com>
2006-03-25 6:10 ` Junio C Hamano
2006-03-25 9:37 ` Johannes Schindelin
2006-03-25 11:08 ` Mark Wooding
2006-03-25 11:26 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0603242014160.15714@g5.osdl.org \
--to=torvalds@osdl.org \
--cc=elf@buici.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).