aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-checkout.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-05-29 14:23:10 -0700
committerJunio C Hamano <gitster@pobox.com>2013-05-29 14:23:10 -0700
commit77eb44b8ed601a17a5ec9b1fb8c4c53ba10aaa56 (patch)
tree9f4d26a64befc377a299f2b98ac551cc824e28a9 /Documentation/git-checkout.txt
parent3e1e7624aa2aa39890ca49d0f7bd3af397c22b03 (diff)
parent229177aaea295a3f804f98494d7bcde9c088fc0a (diff)
downloadgit-77eb44b8ed601a17a5ec9b1fb8c4c53ba10aaa56.tar.gz
Merge branch 'jh/checkout-auto-tracking'
Update "git checkout foo" that DWIMs the intended "upstream" and turns it into "git checkout -t -b foo remotes/origin/foo" to correctly take existing remote definitions into account. The remote "origin" may be what uniquely map its own branch to remotes/some/where/foo but that some/where may not be "origin". * jh/checkout-auto-tracking: glossary: Update and rephrase the definition of a remote-tracking branch branch.c: Validate tracking branches with refspecs instead of refs/remotes/* t9114.2: Don't use --track option against "svn-remote"-tracking branches t7201.24: Add refspec to keep --track working t3200.39: tracking setup should fail if there is no matching refspec. checkout: Use remote refspecs when DWIMming tracking branches t2024: Show failure to use refspec when DWIMming remote branch names t2024: Add tests verifying current DWIM behavior of 'git checkout <branch>'
Diffstat (limited to 'Documentation/git-checkout.txt')
-rw-r--r--Documentation/git-checkout.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 23a9413525..ca118ac6bf 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -131,9 +131,9 @@ entries; instead, unmerged entries are ignored.
"--track" in linkgit:git-branch[1] for details.
+
If no '-b' option is given, the name of the new branch will be
-derived from the remote-tracking branch. If "remotes/" or "refs/remotes/"
-is prefixed it is stripped away, and then the part up to the
-next slash (which would be the nickname of the remote) is removed.
+derived from the remote-tracking branch, by looking at the local part of
+the refspec configured for the corresponding remote, and then stripping
+the initial part up to the "*".
This would tell us to use "hack" as the local branch when branching
off of "origin/hack" (or "remotes/origin/hack", or even
"refs/remotes/origin/hack"). If the given name has no slash, or the above