Re: git-switch(1) then git-pull(1)

From: Nuno Teixeira <>
Date: Sat, 03 Dec 2022 18:15:14 UTC
Really nice.

I'm thinking on 3 trees for ports:

- main (push)
- 2022Qn (cherry-pick, push)
- test (push to main when testing done)

$ git clone ports/main
$ cd ports/main
$ git worktree add ../2022Q4 -b 2022Q4 origin/2022Q4
$ git worktree add ../test -b main origin/main

My question is how do I push a commit from 'test' to 'main'?

This sugestion is because I can have several ports in testing fase on
'test' branch and choose a specific commit to push to 'main' (local branch)
and then do a final push.

Does this makes sense?

Warner Losh <> escreveu no dia sábado, 3/12/2022 à(s) 16:16:

> On Sat, Dec 3, 2022 at 8:59 AM Nuno Teixeira <> wrote:
>> Hello,
>> $ git clone ports/main
>>> $ cd ports/main
>>> $ git worktree add ../2022Q4 -b 2022Q4 origin/2022Q4
>> So we will have ports/{main,2022Q4} and cd to main or 2022Q4 according if
>> commit is to main or quarterly?
>> I will try this soon because swithing from branches is not the best way
>> (but I used it for about 1 year without problems).
> I do this for my src commits. I have 3 trees: 'head', 'stable-13' and
> 'stable-12'. I have a lot of branches off of head
> for work in progress that I switch between all the time to refine, finish
> and land them. For especially large projects
> I'll have a separate work tree, but usually the changes are small enough
> that this works fine. I have a script that
> rebases everything once and a while to keep my branches in sync. For
> stable-12 I have a stable/12 branch locally
> that mirrors upstream. I also have a stable/mfc12 branche that I
> 'insta-MFC' changes that I commit to head that need
> time to cook before being pushed. I do this so I don't lose things. I then
> rebase the stable/mfc12 onto stable/12 and push
> when the time comes (doing the rebase dance as needed).
> Warner

Nuno Teixeira
FreeBSD Committer (ports)