git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: "Maris\, Rob" <maris.rob@ingenieur.de>
Cc: git@vger.kernel.org
Subject: Re: git checkout -b following git reset --hard pitfall
Date: Sun, 09 Sep 2012 15:57:03 +0200	[thread overview]
Message-ID: <m2mx0z47v4.fsf@igel.home> (raw)
In-Reply-To: <op.wkdd9andsuzgrs@rob-desktop> (Rob Maris's message of "Sun, 09 Sep 2012 15:25:48 +0200")

"Maris, Rob" <maris.rob@ingenieur.de> writes:

> Normally, when there are modifications in the working tree not yet added
> resp. committed, git will refuse to change to another branch.

Only if switching the branch requires touching the modified files.

> Actually, the modified
> status of git related to both branches after git checkout -b can have
> following consequences:
>
> - it is lost definitely when git reset -hard is executed

This is true regardless.

> - if committed, it is committed into the newly created branch

This is often the desired state, and there is no harm in doing it
accidentally.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

      reply	other threads:[~2012-09-09 13:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-09 13:25 git checkout -b following git reset --hard pitfall Maris, Rob
2012-09-09 13:57 ` Andreas Schwab [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=m2mx0z47v4.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=git@vger.kernel.org \
    --cc=maris.rob@ingenieur.de \
    /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).