From: Junio C Hamano <gitster@pobox•com>
To: r.ductor@gmail•com
Cc: git@vger•kernel.org
Subject: Re: On the behavior of checkout <branch> with uncommitted local changes
Date: Fri, 20 Sep 2013 15:58:27 -0700 [thread overview]
Message-ID: <xmqq1u4jp0bw.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: 2132571.7BXlKkKRkA@ipht-ia-004976
r.ductor@gmail•com writes:
> mmm maybe I'm wrong, but it seems to me that the first statement
> on the index (above) is oversimplifing.
Yes, it was simplified to illustrate the principle, not even trying
to be exhaustive.
The principle is that we allow you to check out a different branch
when you have local changes to the working tree and/or to the index,
as long as we can make the index and the working tree pretend as if
you reached that locally modified state, starting from a clean state
of the branch you are checking out.
That is what "your modifications in context" in the description of
the "-m" option refers to.
It directly follows that a local change to the index at a path is
carried forward when you check out a different branch, if HEAD and
the branch you are checking out have the same contents registered at
the path.
The message you are responding to illustrated that principle by
talking about changes to the working tree but the same principle
applies to changes to the index, as changes to the working tree is
much easier to picture in your mind.
next prev parent reply other threads:[~2013-09-20 22:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-19 9:23 On the behavior of checkout <branch> with uncommitted local changes r.ductor
2013-09-19 17:43 ` Junio C Hamano
2013-09-20 13:33 ` r.ductor
2013-09-20 22:58 ` Junio C Hamano [this message]
2013-09-24 9:25 ` r.ductor
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=xmqq1u4jp0bw.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=r.ductor@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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