diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-10-08 11:34:02 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-10-08 11:34:02 -0700 |
commit | 9b4030cd98c7fa564905979d075aaf1312de8567 (patch) | |
tree | 505dd98ba2a8259e1e4fb18b1a97bca142594407 /Documentation/git-clone.txt | |
parent | 63c0c2c8a0be285be5c3dec6191540d60489b8a0 (diff) | |
parent | 31b808a03290a4f87c571cc1c61f26d8a03c7025 (diff) | |
download | git-9b4030cd98c7fa564905979d075aaf1312de8567.tar.gz |
Merge branch 'rt/maint-clone-single' into maint
A repository created with "git clone --single" had its fetch
refspecs set up just like a clone without "--single", leading the
subsequent "git fetch" to slurp all the other branches, defeating
the whole point of specifying "only this branch".
* rt/maint-clone-single:
clone --single: limit the fetch refspec to fetched branch
Diffstat (limited to 'Documentation/git-clone.txt')
-rw-r--r-- | Documentation/git-clone.txt | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index c1ddd4c2cc..6d98ef3d2a 100644 --- a/Documentation/git-clone.txt +++ b/Documentation/git-clone.txt @@ -29,7 +29,8 @@ currently active branch. After the clone, a plain `git fetch` without arguments will update all the remote-tracking branches, and a `git pull` without arguments will in addition merge the remote master branch into the -current master branch, if any. +current master branch, if any (this is untrue when "--single-branch" +is given; see below). This default configuration is achieved by creating references to the remote branch heads under `refs/remotes/origin` and @@ -152,9 +153,10 @@ objects from the source repository into a pack in the cloned repository. -b <name>:: Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository's HEAD, point to `<name>` branch - instead. `--branch` can also take tags and treat them like - detached HEAD. In a non-bare repository, this is the branch - that will be checked out. + instead. In a non-bare repository, this is the branch that will + be checked out. + `--branch` can also take tags and detaches the HEAD at that commit + in the resulting repository. --upload-pack <upload-pack>:: -u <upload-pack>:: @@ -193,6 +195,11 @@ objects from the source repository into a pack in the cloned repository. clone with the `--depth` option, this is the default, unless `--no-single-branch` is given to fetch the histories near the tips of all branches. + Further fetches into the resulting repository will only update the + remote tracking branch for the branch this option was used for the + initial cloning. If the HEAD at the remote did not point at any + branch when `--single-branch` clone was made, no remote tracking + branch is created. --recursive:: --recurse-submodules:: |