filter-branch: Big syntax change; support rewriting multiple refs
[gitweb.git] / Documentation / git-clone.txt
index 985043facab96a29e7cf19df213539312e7b5642..a0a10e3e26830d59cbb6eaddaab60a83fa601aa9 100644 (file)
@@ -3,7 +3,7 @@ git-clone(1)
 
 NAME
 ----
-git-clone - Clones a repository
+git-clone - Clone a repository into a new directory
 
 
 SYNOPSIS
@@ -11,27 +11,27 @@ SYNOPSIS
 [verse]
 'git-clone' [--template=<template_directory>] [-l [-s]] [-q] [-n] [--bare]
          [-o <name>] [-u <upload-pack>] [--reference <repository>]
-         [--use-separate-remote | --no-separate-remote] <repository>
-         [<directory>]
+         [--depth <depth>] <repository> [<directory>]
 
 DESCRIPTION
 -----------
 
 Clones a repository into a newly created directory, creates
 remote-tracking branches for each branch in the cloned repository
-(visible using `git branch -r`), and creates and checks out a master
-branch equal to the cloned repository's master branch.
+(visible using `git branch -r`), and creates and checks out an initial
+branch equal to the cloned repository's 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 branch.
+current master branch, if any.
 
 This default configuration is achieved by creating references to
 the remote branch heads under `$GIT_DIR/refs/remotes/origin` and
 by initializing `remote.origin.url` and `remote.origin.fetch`
 configuration variables.
 
+
 OPTIONS
 -------
 --local::
@@ -64,6 +64,7 @@ OPTIONS
        Operate quietly.  This flag is passed to "rsync" and
        "git-fetch-pack" commands when given.
 
+--no-checkout::
 -n::
        No checkout of HEAD is performed after the clone is complete.
 
@@ -76,16 +77,13 @@ OPTIONS
        Also the branch heads at the remote are copied directly
        to corresponding local branch heads, without mapping
        them to `refs/remotes/origin/`.  When this option is
-       used, neither the `origin` branch nor the default
-       `remotes/origin` file is created.
+       used, neither remote-tracking branches nor the related
+       configuration variables are created.
 
 --origin <name>::
 -o <name>::
-       Instead of using the branch name 'origin' to keep track
-       of the upstream repository, use <name> instead.  Note
-       that the shorthand name stored in `remotes/origin` is
-       not affected, but the local branch name to pull the
-       remote `master` branch into is.
+       Instead of using the remote name 'origin' to keep track
+       of the upstream repository, use <name> instead.
 
 --upload-pack <upload-pack>::
 -u <upload-pack>::
@@ -99,21 +97,19 @@ OPTIONS
        if unset the templates are taken from the installation
        defined default, typically `/usr/share/git-core/templates`.
 
---use-separate-remote::
-       Save remotes heads under `$GIT_DIR/remotes/origin/` instead
-       of `$GIT_DIR/refs/heads/`.  Only the local master branch is
-       saved in the latter. This is the default.
-
---no-separate-remote::
-       Save remotes heads in the same namespace as the local
-       heads, `$GIT_DIR/refs/heads/'.  In regular repositories,
-       this is a legacy setup git-clone created by default in
-       older Git versions, and will be removed before the next
-       major release.
+--depth <depth>::
+       Create a 'shallow' clone with a history truncated to the
+       specified number of revs.  A shallow repository has
+       number of limitations (you cannot clone or fetch from
+       it, nor push from nor into it), but is adequate if you
+       want to only look at near the tip of a large project
+       with a long history, and would want to send in a fixes
+       as patches.
 
 <repository>::
-       The (possibly remote) repository to clone from.  It can
-       be any URL git-fetch supports.
+       The (possibly remote) repository to clone from.  See the
+       <<URLS,URLS>> section below for more information on specifying
+       repositories.
 
 <directory>::
        The name of a new directory to clone into.  The "humanish"
@@ -122,6 +118,8 @@ OPTIONS
        for "host.xz:foo/.git").  Cloning into an existing directory
        is not allowed.
 
+include::urls.txt[]
+
 Examples
 --------
 
@@ -138,7 +136,7 @@ Make a local clone that borrows from the current directory, without checking thi
 +
 ------------
 $ git clone -l -s -n . ../copy
-$ cd copy
+$ cd ../copy
 $ git show-branch
 ------------
 
@@ -181,4 +179,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
 GIT
 ---
 Part of the gitlink:git[7] suite
-