Date: Sat, 3 Dec 2022 00:48:52 -0800 From: Xin Li <delphij@delphij.net> To: freebsd-git@freebsd.org Subject: Re: git-switch(1) then git-pull(1) Message-ID: <c1a68261-6245-0c98-e356-3a806480a10b@delphij.net> In-Reply-To: <CAFDf7UJWWHKqAGFWdQHfXTH=H=c0vF1pf1X%2BZO78iDtiL3E=cg@mail.gmail.com> References: <ef399d4c-cb26-2bff-9966-684d3a7b96ad@freebsd.org> <CAFDf7UJWWHKqAGFWdQHfXTH=H=c0vF1pf1X%2BZO78iDtiL3E=cg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2022-12-02 4:08 AM, Nuno Teixeira wrote: > Not sure if I understand but I use `git switch` on ports tree to switch > from 'main' to 'quarterly' to avoid having 2 trees. Somewhat unrelated to the original topic, but why would one want to avoid having two trees? Personally I would use a worktree for this purpose, like: $ git clone https://git.freebsd.org/ports ports/main $ cd ports/main $ git worktree add ../2022Q4 -b 2022Q4 origin/2022Q4 Then both trees would share the same set of git objects; after use the worktree can be deleted with: $ git worktree remove 2022Q4 This is a lot easier than switching between branches, especially when the two branches diverged a lot (like src/). Cheers,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c1a68261-6245-0c98-e356-3a806480a10b>