path: root/builtin/worktree.c
diff options
authorEric Sunshine <>2015-07-06 17:31:00 (GMT)
committerJunio C Hamano <>2015-07-07 21:34:46 (GMT)
commit0d1a1517835a10818f2d40d8780a268dbb5e20ce (patch)
tree34fc59b1e3f82790f86d684513c1ba356fbed390 /builtin/worktree.c
parent1eb07d829f3f0992c93c6b44fdcc4e95ebab12f3 (diff)
checkout: retire --ignore-other-worktrees in favor of --force
As a safeguard, checking out a branch already checked out by a different worktree is disallowed. This behavior can be overridden with --ignore-other-worktrees, however, this option is neither obvious nor particularly discoverable. As a common safeguard override, --force is more likely to come to mind. Therefore, overload it to also suppress the check for a branch already checked out elsewhere. Signed-off-by: Eric Sunshine <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/worktree.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 69248ba..050b443 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -303,7 +303,7 @@ static int add(int ac, const char **av, const char *prefix)
argv_array_push(&cmd, "checkout");
if (force)
- argv_array_push(&cmd, "--ignore-other-worktrees");
+ argv_array_push(&cmd, "--force");
if (new_branch)
argv_array_pushl(&cmd, "-b", new_branch, NULL);
if (new_branch_force)