From: Junio C Hamano Date: Thu, 6 Nov 2025 23:17:31 +0000 (-0800) Subject: Merge branch 'ms/doc-worktree-side-by-side' into seen X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=656c251978fd9cdff5f70aec17706728f8fa90cf;p=thirdparty%2Fgit.git Merge branch 'ms/doc-worktree-side-by-side' into seen Document "git worktree add" and use of out-of-tree worktrees with examples. * ms/doc-worktree-side-by-side: doc: git-worktree: Add side by side branch checkout example doc: git-worktree: Link to examples --- 656c251978fd9cdff5f70aec17706728f8fa90cf diff --cc Documentation/git-worktree.adoc index f272f79783,692e81fe3a..0f82ec5439 --- a/Documentation/git-worktree.adoc +++ b/Documentation/git-worktree.adoc @@@ -79,12 -79,15 +79,15 @@@ with a matching name, treat as equivale $ git worktree add --track -b / ------------ + + For best results it is advised to specify __ outside of the repository + and existing worktrees - see <> + + If the branch exists in multiple remotes and one of them is named by the `checkout.defaultRemote` configuration variable, we'll use that -one for the purposes of disambiguation, even if the `` isn't +one for the purposes of disambiguation, even if the __ isn't unique across all remotes. Set it to e.g. `checkout.defaultRemote=origin` to always checkout remote -branches from there if `` is ambiguous but exists on the +branches from there if __ is ambiguous but exists on the `origin` remote. See also `checkout.defaultRemote` in linkgit:git-config[1]. + @@@ -522,13 -522,16 +526,23 @@@ $ pop $ git worktree remove ../temp ------------ + Side by side branch checkouts for a repository using multiple worktrees + + ------------ + mkdir some-repository + cd some-repository + git clone --bare gitforge@someforge.example.com:some-org/some-repository some-repository.git + git --git-dir=some-repository.git worktree add some-branch + git --git-dir=some-repository.git worktree add another-branch + ------------ + +CONFIGURATION +------------- + +include::includes/cmd-config-section-all.adoc[] + +include::config/worktree.adoc[] + BUGS ---- Multiple checkout in general is still experimental, and the support