From: Johannes Sixt <j.sixt@viscovery.net>
To: Tim Chase <git@tim.thechases.com>
Cc: git@vger.kernel.org
Subject: Re: Splitting a commit with rebase -i and keeping a commit message
Date: Wed, 17 Apr 2013 07:55:41 +0200 [thread overview]
Message-ID: <516E395D.3050307@viscovery.net> (raw)
In-Reply-To: <20130416203825.3701d98b@bigbox.christie.dr>
Am 4/17/2013 3:38, schrieb Tim Chase:
> I asked this on IRC and played with some of their ideas, but struck
> out with anything satisfying. I walked through [1] with the
> following setup:
>
> git init foo
> cd foo
> touch a.txt b.txt
> git add a.txt b.txt
> git commit -m "Initial checkin"
> echo "Modify A" >> a.txt
> git commit -am "Modified A"
> echo "Modify B" >> b.txt
> git commit -am "Modified B"
> echo "Modify A2" >> a.txt
> echo "Modify B2" >> b.txt
> git commit -am "Modified B"
> git commit -am "Long-bodied commit comment about b.txt changes"
> # whoops, just wanted B
> git rebase -i HEAD^^
> # change the "Added b.txt..." commit to "edit"
# and duplicate the instruction line
git checkout HEAD^ b.txt # undo b.txt
git commit --amend -m "Tweaked a.txt"
git rebase --continue
# in real world cases, you are likely to see conflicts here
# when the commit is applied a second time,
# but not in this toy example
git rebase --continue
-- Hannes
prev parent reply other threads:[~2013-04-17 5:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-17 1:38 Splitting a commit with rebase -i and keeping a commit message Tim Chase
2013-04-17 2:29 ` David Aguilar
2013-04-17 3:04 ` Tim Chase
2013-04-17 5:55 ` Johannes Sixt [this message]
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=516E395D.3050307@viscovery.net \
--to=j.sixt@viscovery.net \
--cc=git@tim.thechases.com \
--cc=git@vger.kernel.org \
/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.