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

From: Nuno Teixeira <eduardo_at_freebsd.org>
Date: Fri, 02 Dec 2022 12:08:56 UTC
Not sure if I understand but I use `git switch` on ports tree to switch
from 'main' to 'quarterly' to avoid having 2 trees.

e.g.
When in main and need to do a commit on 2022Q4:
`git switch 2022Q4`
`git pull --rebase`
`git cherry-pick -x XXX`
`git push`

and switch back to main:
`git switch -` or `git switch main`
`git pull --rebase`

Hope that helps



Graham Perrin <grahamperrin@freebsd.org> escreveu no dia sexta, 2/12/2022
à(s) 08:04:

> I'm confused.
>
> If a switch is intended to update things, then how can an immediately
> subsequent pull lead to updates?
>
>
> % git -C /usr/ports switch main && git -C /usr/src switch main
> Already on 'main'
> Your branch is up to date with 'freebsd/main'.
> M       sys/netgraph/bluetooth/hci/ng_hci_cmds.c
> M       sys/netgraph/bluetooth/hci/ng_hci_evnt.c
> M       sys/netgraph/bluetooth/include/ng_hci.h
> Already on 'main'
> Your branch is up to date with 'origin/main'.
> % git -C /usr/ports pull --ff-only && git -C /usr/src pull --ff-only
> remote: Enumerating objects: 3284, done.
> remote: Counting objects: 100% (840/840), done.
> remote: Compressing objects: 100% (3/3), done.
> remote: Total 3284 (delta 837), reused 837 (delta 837), pack-reused 2444
> Receiving objects: 100% (3284/3284), 1.92 MiB | 1.11 MiB/s, done.
> Resolving deltas: 100% (1985/1985), completed with 474 local objects.
> From https://git.freebsd.org/ports
>    fb6a9af3e898..80afc63eeb99  main       -> freebsd/main
>    749ca3ec2e60..c3552efe398e  2022Q4     -> freebsd/2022Q4
> Updating fb6a9af3e898..80afc63eeb99
> ^C
> % cat /usr/ports/.git/config
> [core]
>         repositoryformatversion = 0
>         filemode = true
>         bare = false
>         logallrefupdates = true
> [remote "freebsd"]
>         url = https://git.freebsd.org/ports.git
>         fetch = +refs/heads/*:refs/remotes/freebsd/*
> [branch "main"]
>         remote = freebsd
>         merge = refs/heads/main
> %
>
> Git - git-switch Documentation <https://git-scm.com/docs/git-switch>
>


-- 
Nuno Teixeira
FreeBSD Committer (ports)