From: Junio C Hamano <gitster@pobox.com>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Michael Witten <mfwitten@gmail.com>,
Avery Pennarun <apenwarr@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH] Clarification for the command "git checkout <branch>"
Date: Tue, 30 Mar 2010 15:13:25 -0700 [thread overview]
Message-ID: <7vd3ylv4oq.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4BB21F6D.7070804@web.de> (Markus Elfring's message of "Tue\, 30 Mar 2010 17\:57\:33 +0200")
Markus Elfring <Markus.Elfring@web.de> writes:
>> I find that the discussion is not finished yet. It was not achieved a common
>> conclusion and consensus on all mentioned details so far.
>
> Can we achieve progress for an update of the manual?
>
> Regards,
> Markus
Something like this?
Documentation/git-checkout.txt | 27 ++++++++++++++++++++++++---
1 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 37c1810..d443a12 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -16,9 +16,9 @@ SYNOPSIS
DESCRIPTION
-----------
-When <paths> are not given, this command switches branches by
-updating the index, working tree, and HEAD to reflect the specified
-branch.
+When <paths> are not given, this command makes the named branch the
+current branch, so that a further work will be committed on that branch.
+See "Switching Branches" below.
If `-b` is given, a new branch is created and checked out, as if
linkgit:git-branch[1] were called; in this case you can
@@ -149,6 +149,27 @@ checks out the branch (instead of detaching). You may also specify
the index will be used.
+Switching Branches
+------------------
+
+While switching to another branch (or more in general, to another commit
+that is not the current commit), the index and the working tree are
+updated to the contents of the new branch, while carrying the uncommitted
+changes you made so far along with you. People often start making changes
+and then realize that the changes belong to a branch that is different
+from the current one, and it helps these people to carry the changes
+forward upon switching branches.
+
+If the branch you are switching to has one version of a file, and the
+current branch has a different version of it, which you changed in your
+working tree to yet another version, carrying the changes forward is not
+possible without merging. But you may not be ready to resolve such
+conflicts right now. By default, the command refuses to switch branches
+to prevent you from losing your local changes due to such conflicts. In
+such a case, you may want retry the command after recording the local
+changes (1) in a temporary commit on the current branch, or (2) by using
+"git stash". Alternatively, use "-m" option to force a merge.
+
Detached HEAD
-------------
next prev parent reply other threads:[~2010-03-30 22:13 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-01 18:50 Better cooperation between checkouts and stashing Markus Elfring
2010-02-01 20:40 ` Junio C Hamano
2010-02-01 21:57 ` Markus Elfring
2010-02-01 22:44 ` Eugene Sajine
2010-02-02 1:36 ` Petr Baudis
2010-02-02 10:26 ` Markus Elfring
2010-02-02 11:04 ` Petr Baudis
2010-02-09 19:20 ` Markus Elfring
2010-02-09 20:06 ` Junio C Hamano
2010-02-09 21:01 ` Markus Elfring
2010-02-18 17:43 ` Markus Elfring
2010-02-18 20:09 ` Junio C Hamano
2010-02-27 21:33 ` Markus Elfring
2010-02-27 21:51 ` Junio C Hamano
2010-02-28 13:55 ` Markus Elfring
2010-02-28 22:57 ` Michael Witten
2010-03-01 10:50 ` Markus Elfring
2010-03-01 17:02 ` Michael Witten
2010-03-01 17:23 ` Junio C Hamano
2010-03-01 18:14 ` Michael Witten
2010-03-01 18:29 ` Markus Elfring
2010-03-01 19:44 ` Junio C Hamano
2010-03-01 21:20 ` Markus Elfring
2010-03-02 1:41 ` Michael Witten
2010-03-02 9:35 ` Markus Elfring
2010-03-02 17:50 ` Junio C Hamano
2010-03-03 15:55 ` Markus Elfring
2010-03-04 7:46 ` Michael Witten
2010-03-04 19:55 ` Markus Elfring
2010-03-02 9:45 ` Markus Elfring
2010-03-02 18:05 ` Junio C Hamano
2010-03-03 16:00 ` Markus Elfring
2010-03-17 16:35 ` [PATCH] Clarification for the command "git checkout <branch>" Markus Elfring
2010-03-17 16:44 ` Avery Pennarun
2010-03-17 17:00 ` Markus Elfring
2010-03-17 17:58 ` Junio C Hamano
2010-03-17 18:21 ` Markus Elfring
2010-03-17 18:37 ` Junio C Hamano
2010-03-17 18:50 ` Michael Witten
2010-03-17 19:23 ` Junio C Hamano
2010-03-18 10:11 ` Markus Elfring
2010-03-18 16:36 ` Avery Pennarun
2010-03-18 17:19 ` Michael Witten
2010-03-18 17:33 ` Avery Pennarun
2010-03-19 8:28 ` Markus Elfring
2010-03-19 17:17 ` Avery Pennarun
2010-03-20 6:00 ` Markus Elfring
2010-03-19 8:15 ` Markus Elfring
2010-03-30 15:57 ` Markus Elfring
2010-03-30 22:13 ` Junio C Hamano [this message]
2010-03-31 3:58 ` Ramkumar Ramachandra
2010-04-01 4:52 ` Junio C Hamano
2010-04-01 13:09 ` Ramkumar Ramachandra
2010-04-01 6:38 ` Markus Elfring
2010-04-10 13:30 ` Markus Elfring
2010-04-10 22:31 ` Junio C Hamano
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=7vd3ylv4oq.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Markus.Elfring@web.de \
--cc=apenwarr@gmail.com \
--cc=git@vger.kernel.org \
--cc=mfwitten@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 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).