diff --git a/Documentation/git-worktree.adoc b/Documentation/git-worktree.adoc index 4399a131de..056a852bb6 100644 --- a/Documentation/git-worktree.adoc +++ b/Documentation/git-worktree.adoc @@ -79,6 +79,9 @@ with a matching name, treat as equivalent to: $ 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 @@ -502,6 +505,7 @@ locked "reason\nwhy is locked" ... ------------ +[[EXAMPLES]] EXAMPLES -------- You are in the middle of a refactoring session and your boss comes in and @@ -522,6 +526,16 @@ $ popd $ 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 -------------