Re: [PATCH 0/1] Introduce a way to create a branch and worktree at the same time
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Mar 10, 2016, 11:59 UTC
- Message-ID
- <CACsJy8D7+sXF9gRj15kidgK_xzSVHqChSFdqHpJ3PwxMOw2rHA@mail.gmail.com>
- In-Reply-To
- <CACsJy8BA7-ev9wTt6K45TgiNxOaBUXbN1P03U4EUAzAPy=7Faw@mail.gmail.com>
On Thu, Mar 10, 2016 at 6:51 PM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 6 quoted lines
>> It gets rather tiresome, and also typo-prone, to call "git branch xyz >> upstream/master && git worktree add xyz xyz" all the time. > > You can actually do "git worktree -b xyz xyz upstream/master" for the > same effect. Maybe we can avoid "xyz" duplication with "-b -" or a new > option name?
Another option is just do "worktree -b xyz . upstream/master"
when the destination already exists and is a directory, the real worktree location is <dest>/<branch name>. Similar to "mv abc def" becomes "mv abc def/abc" when def is already a directory.
-- Duy