diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-02-17 10:03:40 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-02-17 10:03:40 -0800 |
commit | 88221d92cbc21f629b60eb046e5aabd6cdc67cca (patch) | |
tree | 1b12cd7368058dfb8bca8a9b695e8914a2679d77 /Documentation | |
parent | Merge branch 'js/xmerge-marker-eol' into maint (diff) | |
parent | worktree: stop supporting moving worktrees manually (diff) | |
download | tgif-88221d92cbc21f629b60eb046e5aabd6cdc67cca.tar.xz |
Merge branch 'nd/do-not-move-worktree-manually' into maint
"git worktree" had a broken code that attempted to auto-fix
possible inconsistency that results from end-users moving a
worktree to different places without telling Git (the original
repository needs to maintain backpointers to its worktrees, but
"mv" run by end-users who are not familiar with that fact will
obviously not adjust them), which actually made things worse
when triggered.
* nd/do-not-move-worktree-manually:
worktree: stop supporting moving worktrees manually
worktree.c: fix indentation
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-worktree.txt | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt index 5b9ad0429c..62c76c1c89 100644 --- a/Documentation/git-worktree.txt +++ b/Documentation/git-worktree.txt @@ -32,11 +32,9 @@ The working tree's administrative files in the repository (see `git worktree prune` in the main or any linked working tree to clean up any stale administrative files. -If you move a linked working tree to another file system, or -within a file system that does not support hard links, you need to run -at least one git command inside the linked working tree -(e.g. `git status`) in order to update its administrative files in the -repository so that they do not get automatically pruned. +If you move a linked working tree, you need to manually update the +administrative files so that they do not get pruned automatically. See +section "DETAILS" for more information. If a linked working tree is stored on a portable device or network share which is not always mounted, you can prevent its administrative files from @@ -137,6 +135,13 @@ thumb is do not make any assumption about whether a path belongs to $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. +If you move a linked working tree, you need to update the 'gitdir' file +in the entry's directory. For example, if a linked working tree is moved +to `/newpath/test-next` and its `.git` file points to +`/path/main/.git/worktrees/test-next`, then update +`/path/main/.git/worktrees/test-next/gitdir` to reference `/newpath/test-next` +instead. + To prevent a $GIT_DIR/worktrees entry 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 |