]> Pileus Git - ~andy/git/commitdiff
Merge branch 'jh/checkout-auto-tracking'
authorJunio C Hamano <gitster@pobox.com>
Wed, 29 May 2013 21:23:10 +0000 (14:23 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 29 May 2013 21:23:10 +0000 (14:23 -0700)
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>'

1  2 
Documentation/git-checkout.txt
Documentation/glossary-content.txt
branch.c
builtin/checkout.c

Simple merge
index 68a18e14975fadb0cba7ba19e45438887a65bd4f,7a79f26231c2ffa0cd0bfb7ffb9274803e32d8be..db2a74df934f3acd93521e42510b6cd00c9eed6f
@@@ -397,15 -412,24 +397,16 @@@ should not be combined with other paths
  [[def_refspec]]refspec::
        A "refspec" is used by <<def_fetch,fetch>> and
        <<def_push,push>> to describe the mapping between remote
 -      <<def_ref,ref>> and local ref. They are combined with a colon in
 -      the format <src>:<dst>, preceded by an optional plus sign, +.
 -      For example: `git fetch $URL
 -      refs/heads/master:refs/heads/origin` means "grab the master
 -      <<def_branch,branch>> <<def_head,head>> from the $URL and store
 -      it as my origin branch head". And `git push
 -      $URL refs/heads/master:refs/heads/to-upstream` means "publish my
 -      master branch head as to-upstream branch at $URL". See also
 -      linkgit:git-push[1].
 +      <<def_ref,ref>> and local ref.
  
  [[def_remote_tracking_branch]]remote-tracking branch::
-       A regular Git <<def_branch,branch>> that is used to follow changes from
-       another <<def_repository,repository>>. A remote-tracking
-       branch should not contain direct modifications or have local commits
-       made to it. A remote-tracking branch can usually be
-       identified as the right-hand-side <<def_ref,ref>> in a Pull:
-       <<def_refspec,refspec>>.
+       A <<def_ref,ref>> that is used to follow changes from another
+       <<def_repository,repository>>. It typically looks like
+       'refs/remotes/foo/bar' (indicating that it tracks a branch named
+       'bar' in a remote named 'foo'), and matches the right-hand-side of
+       a configured fetch <<def_refspec,refspec>>. A remote-tracking
+       branch should not contain direct modifications or have local
+       commits made to it.
  
  [[def_repository]]repository::
        A collection of <<def_ref,refs>> together with an
diff --cc branch.c
Simple merge
Simple merge