Skip to content

Commit

Permalink
docs/clone: mention that --local may be ignored
Browse files Browse the repository at this point in the history
The --local flag is not "treat this like a local
repository", but rather "if we are local, turn on
optimizations". Therefore it does nothing in the case of:

  git clone --local file:///path/to/repo

Let's make that more clear in the documentation.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed May 30, 2012
1 parent 0680f74 commit 9197a10
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Documentation/git-clone.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ OPTIONS
mechanism and clones the repository by making a copy of
HEAD and everything under objects and refs directories.
The files under `.git/objects/` directory are hardlinked
to save space when possible. This is now the default when
the source repository is specified with `/path/to/repo`
syntax, so it essentially is a no-op option. To force
copying instead of hardlinking (which may be desirable
if you are trying to make a back-up of your repository),
but still avoid the usual "git aware" transport
mechanism, `--no-hardlinks` can be used.
to save space when possible.
+
If the repository is specified as a local path (e.g., `/path/to/repo`),
this is the default, and --local is essentially a no-op. If the
repository is specified as a URL, then this flag is ignored (and we
never use the local optimizations).
+
To force copying instead of hardlinking (which may be desirable if you
are trying to make a back-up of your repository), but still avoid the
usual "git aware" transport mechanism, `--no-hardlinks` can be used.

--no-hardlinks::
Optimize the cloning process from a repository on a
Expand Down

0 comments on commit 9197a10

Please sign in to comment.