Skip to content

Commit 563055e

Browse files
committed
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
2 parents f1e5780 + b0380a8 commit 563055e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Documentation/git-worktree.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ with a matching name, treat as equivalent to:
7979
$ git worktree add --track -b <branch> <path> <remote>/<branch>
8080
------------
8181
+
82+
For best results it is advised to specify _<path>_ outside of the repository
83+
and existing worktrees - see <<EXAMPLES,EXAMPLES>>
84+
+
8285
If the branch exists in multiple remotes and one of them is named by
8386
the `checkout.defaultRemote` configuration variable, we'll use that
8487
one for the purposes of disambiguation, even if the _<branch>_ isn't
@@ -502,6 +505,7 @@ locked "reason\nwhy is locked"
502505
...
503506
------------
504507

508+
[[EXAMPLES]]
505509
EXAMPLES
506510
--------
507511
You are in the middle of a refactoring session and your boss comes in and
@@ -522,6 +526,16 @@ $ popd
522526
$ git worktree remove ../temp
523527
------------
524528
529+
Side by side branch checkouts for a repository using multiple worktrees
530+
531+
------------
532+
mkdir some-repository
533+
cd some-repository
534+
git clone --bare gitforge@someforge.example.com:some-org/some-repository some-repository.git
535+
git --git-dir=some-repository.git worktree add some-branch
536+
git --git-dir=some-repository.git worktree add another-branch
537+
------------
538+
525539
CONFIGURATION
526540
-------------
527541

0 commit comments

Comments
 (0)