From: Bruno Haible <bruno@clisp.org>
To: Elijah Newren <newren@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: request for documentation about branch surgery
Date: Tue, 7 Jul 2009 11:51:02 +0200 [thread overview]
Message-ID: <200907071151.03567.bruno@clisp.org> (raw)
In-Reply-To: <51419b2c0907061930k71e20b42rb347b9ab8923e437@mail.gmail.com>
Hi Elijah,
> When the cost of certain activities changes dramatically (which git
> does by making lots new things possible and fast), formerly "exotic"
> usecases can become natural and common -- and really helpful.
Yes. With cvs, I would not never have dared to do branch surgery. With
git, I can - assuming some documentation. "git clone", "git checkout",
"git commit" each serves a particular purpose, so one can understand
when to use which command. But for branch surgery, several commands
are available:
- "git reset --hard"
- "git rebase"
- "git rebase --onto"
- "git merge" (simple case, no merge commit)
The mapping from "How do I ..." questions to command is not easy,
therefore a user's manual like
<http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#rewriting-one-commit>
is needed.
Thanks for correcting me and showing simpler alternatives to what
I said.
Still, can someone please extend the cited chapter of the user's manual,
so that it answers these questions?
- How do I change the last commit in a branch? [DONE]
- How do I change an older commit in a branch? [DONE]
- How do I insert some commits between other commits in a branch?
[TODO]
- How do I reorder commits in a branch? [TODO - mention "git rebase -i"]
- How do I copy selected commits from a branch to another?
[DONE]
- How do I cut a branch? [TODO]
- How do I replace a branch tip with the contents of another branch?
[TODO]
- How do I reconnect a branch to another branch point?
[TODO]
> I think
> the rebase command would be much easier to understand for new users if
> it used an "--against" before the first reference(*).
Don't know, this is just a cosmetic change. The thing that confused me
about "git rebase" is that its thinking is focused on the current branch.
Whereas when I'm doing branch surgery, I'm creating a new branch
bottom-up, so my thinking is "here I have some commits, what can I do
with them". It requires a good user's manual to map this to the right
"git rebase" command.
Bruno
next prev parent reply other threads:[~2009-07-07 9:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-06 23:05 request for documentation about branch surgery Bruno Haible
2009-07-07 2:30 ` Elijah Newren
2009-07-07 3:45 ` Elijah Newren
2009-07-07 9:51 ` Bruno Haible [this message]
2009-07-07 10:06 ` Andreas Ericsson
2009-07-07 2:50 ` Junio C Hamano
2009-07-07 10:13 ` Bruno Haible
2009-07-07 11:03 ` Andreas Ericsson
2009-07-07 15:52 ` Junio C Hamano
2009-07-07 18:28 ` Daniel Barkalow
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=200907071151.03567.bruno@clisp.org \
--to=bruno@clisp.org \
--cc=git@vger.kernel.org \
--cc=newren@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.