From: Christian Halstrick <christian.halstrick@gmail.com>
To: git <git@vger.kernel.org>
Subject: why is merging with unstaged changes allowed when rebasing is not?
Date: Fri, 4 Mar 2011 17:32:19 +0100 [thread overview]
Message-ID: <AANLkTi=dnyaPTX0Y43nbAGp46NtscKT3a2idxEhkreMm@mail.gmail.com> (raw)
Isn't it inconsistent that I can merge with unstaged changes in my
work-tree but not rebase? I agree that both should fail if the
operation would have to touch the file which has unstaged changes. But
if not - why don't we allow the rebase? (Is it just because we
technically do a "git reset --hard" during the rebase which fails on
unstaged changes?). Here is how tried it out:
git init
touch a b
git add a b
git commit -m initial
echo "a-master" >> a
git commit -a -m "modified a on master"
git checkout -b side HEAD~1
touch c
git add c
git commit -m "added c on side"
echo "b-side" >> b
# git rebase master -> would fail complaining about unstaged changes
# git merge master -> would not fail
Even a 'git checkout master; git cherry-pick side' works well (but
updates the wrong branch)
Ciao
Chris
next reply other threads:[~2011-03-04 16:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-04 16:32 Christian Halstrick [this message]
2011-03-04 17:53 ` why is merging with unstaged changes allowed when rebasing is not? Junio C Hamano
2011-03-07 2:38 ` Neal Kreitzinger
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='AANLkTi=dnyaPTX0Y43nbAGp46NtscKT3a2idxEhkreMm@mail.gmail.com' \
--to=christian.halstrick@gmail.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 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).