summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLibravatar Nguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-11-30 15:24:53 +0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-12-01 11:00:18 -0800
commite3df33bb1b14207848ff339ca27644a01ef17c26 (patch)
tree1984a1b4e36f2742cb078eca6918c32f753370b9 /Documentation
parentgc: factor out gc.pruneexpire parsing code (diff)
downloadtgif-e3df33bb1b14207848ff339ca27644a01ef17c26.tar.xz
gc: support prune --worktrees
Helped-by: Marc Branchaud <marcnarc@xiplink.com> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/config.txt7
-rw-r--r--Documentation/git-checkout.txt11
2 files changed, 14 insertions, 4 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt
index e1623ec6d1..2700a1bb83 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1229,6 +1229,13 @@ gc.pruneexpire::
"now" may be used to disable this grace period and always prune
unreachable objects immediately.
+gc.pruneworktreesexpire::
+ When 'git gc' is run, it will call
+ 'prune --worktrees --expire 3.months.ago'.
+ Override the grace period with this config variable. The value
+ "now" may be used to disable the grace period and prune
+ $GIT_DIR/worktrees immediately.
+
gc.reflogexpire::
gc.<pattern>.reflogexpire::
'git reflog expire' removes reflog entries older than
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 35675da2b8..0c13825e61 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -435,8 +435,11 @@ $GIT_DIR or $GIT_COMMON_DIR when you need to directly access something
inside $GIT_DIR. Use `git rev-parse --git-path` to get the final path.
When you are done with a linked working tree you can simply delete it.
-You can clean up any stale $GIT_DIR/worktrees entries via `git prune
---worktrees` in the main or any linked working tree.
+The working tree's entry in the repository's $GIT_DIR/worktrees
+directory will eventually be removed automatically (see
+`gc.pruneworktreesexpire` in linkgit::git-config[1]), or you can run
+`git prune --worktrees` in the main or any linked working tree to
+clean up any stale entries in $GIT_DIR/worktrees.
If you move a linked working directory to another file system, or
within a file system that does not support hard links, you need to run
@@ -444,8 +447,8 @@ at least one git command inside the linked working directory
(e.g. `git status`) in order to update its entry in $GIT_DIR/worktrees
so that it does not get automatically removed.
-To prevent `git prune --worktrees` from deleting a $GIT_DIR/worktrees
-entry (which can be useful in some situations, such as when the
+To prevent a $GIT_DIR/worktrees entry from from being pruned (which
+can be useful in some situations, such as when the
entry's working tree is stored on a portable device), add a file named
'locked' to the entry's directory. The file contains the reason in
plain text. For example, if a linked working tree's `.git` file points