]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/clone.c
clone: accept config options on the command line
authorJeff King <peff@peff.net>
Thu, 9 Jun 2011 20:56:19 +0000 (16:56 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 22 Jun 2011 18:25:21 +0000 (11:25 -0700)
commit84054f79de35015fc92f73ec4780102dd820e452
tree9b85fe6d35164284cd5601ffd051011c4224512f
parent2496844bb2e5410019bf51c10b1f3068b621fa27
clone: accept config options on the command line

Clone does all of init, "remote add", fetch, and checkout
without giving the user a chance to intervene and set any
configuration. This patch allows you to set config options
in the newly created repository after the clone, but before
we do any other operations.

In many cases, this is a minor convenience over something
like:

  git clone git://...
  git config core.whatever true

But in some cases, it can bring extra efficiency by changing
how the fetch or checkout work. For example, setting
line-ending config before the checkout avoids having to
re-checkout all of the contents with the correct line
endings.

It also provides a mechanism for passing information to remote
helpers during a clone; the helpers may read the git config
to influence how they operate.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-clone.txt
builtin/clone.c
t/t5708-clone-config.sh [new file with mode: 0755]