Skip to content

Commit 1eaf3f5

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. Comments? * ms/doc-worktree-side-by-side: amend! doc: git-worktree: Add side by side branch checkout example doc: git-worktree: Add side by side branch checkout example amend! doc: git-worktree: Link to examples doc: git-worktree: Link to examples
2 parents 646c88a + c8416f1 commit 1eaf3f5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Documentation/git-worktree.adoc

Lines changed: 15 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 and
83+
existing worktrees - see <<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,17 @@ $ popd
522526
$ git worktree remove ../temp
523527
------------
524528
529+
Side by side branch checkouts for a repository using multiple worktrees;
530+
let's imagine we participate in a project "bunny".
531+
532+
------------
533+
mkdir
534+
cd bunny
535+
git clone --bare [email protected]:some-org/bunny bunny.git
536+
git --git-dir=bunny.git worktree add some-branch
537+
git --git-dir=bunny.git worktree add another-branch
538+
------------
539+
525540
CONFIGURATION
526541
-------------
527542

0 commit comments

Comments
 (0)