From: Robert P. J. Day Date: Sun, 21 Jan 2018 12:02:10 GMT Subject: Re: [PATCH] worktree: teach "add" to check out existing branches Message-ID: In-Reply-To: <20180121120208.12760-1-t.gummerer@gmail.com> On Sun, 21 Jan 2018, Thomas Gummerer wrote: > Currently 'git worktree add ' creates a new branch named after the > basename of the path by default. If a branch with that name already > exists, the command refuses to do anything, unless the '--force' option > is given. > > However we can do a little better than that, and check the branch out if > it is not checked out anywhere else. This will help users who just want > to check an existing branch out into a new worktree, and save a few > keystrokes. > > As the current behaviour is to simply 'die()' when a brach with the name ^^^^^