aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/config.txt
diff options
context:
space:
mode:
authorBen Peart <Ben.Peart@microsoft.com>2018-08-16 18:27:11 +0000
committerJunio C Hamano <gitster@pobox.com>2018-08-16 11:54:57 -0700
commitfa655d8411cc2d7ffcf898e53a1493c737d7de68 (patch)
tree80a88418d738aa4701155f7c3cf3cc38b6836052 /Documentation/config.txt
parentffc6fa0e396238de3a30623912980263b4f283ab (diff)
downloadgit-fa655d8411cc2d7ffcf898e53a1493c737d7de68.tar.gz
checkout: optimize "git checkout -b <new_branch>"
Skip merging the commit, updating the index and working directory if and only if we are creating a new branch via "git checkout -b <new_branch>." Any other checkout options will still go through the former code path. If sparse_checkout is on, require the user to manually opt in to this optimzed behavior by setting the config setting checkout.optimizeNewBranch to true as we will no longer update the skip-worktree bit in the index, nor add/remove files in the working directory to reflect the current sparse checkout settings. For comparison, running "git checkout -b <new_branch>" on a large repo takes: 14.6 seconds - without this patch 0.3 seconds - with this patch Signed-off-by: Ben Peart <Ben.Peart@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/config.txt')
-rw-r--r--Documentation/config.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 43b2de7b5f..1a2deeaf20 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1101,6 +1101,14 @@ browser.<tool>.path::
browse HTML help (see `-w` option in linkgit:git-help[1]) or a
working repository in gitweb (see linkgit:git-instaweb[1]).
+checkout.optimizeNewBranch
+ Optimizes the performance of "git checkout -b <new_branch>" when
+ using sparse-checkout. When set to true, git will not update the
+ repo based on the current sparse-checkout settings. This means it
+ will not update the skip-worktree bit in the index nor add/remove
+ files in the working directory to reflect the current sparse checkout
+ settings nor will it show the local changes.
+
clean.requireForce::
A boolean to make git-clean do nothing unless given -f,
-i or -n. Defaults to true.