Solved ports: git fetch origin gives an error - why?

in /usr/ports
git branch
* 2025Q2
I want to switch to 2025Q3 without delete the whole port tree and check it out again.
in https://github.com/freebsd/freebsd-ports there is a new branch 2025Q3

I try:
git -C /usr/ports checkout -b 2025Q3
--> Switched to a new branch '2025Q3'
git pull
--> Already up to date. | Nothing has fetched and changed. I go back to 2025Q2 and delete the self created 2025Q3. This hasn't work.

next:
git config -l
-->remote.origin.url=https://git.freebsd.org/ports.git
remote.origin.fetch=+refs/heads/2025Q2:refs/remotes/origin/2025Q2
branch.2025Q2.remote=origin
branch.2025Q2.merge=refs/heads/2025Q2

git fetch origin 2025Q3
--> error: RPC failed; HTTP 504 curl 22 The requested URL returned error: 504
--> fatal: expected 'packfile'

How can I solve this?
 
I try:
git -C /usr/ports checkout -b 2025Q3
--> Switched to a new branch '2025Q3'
git pull
--> Already up to date. | Nothing has fetched and changed. I go back to 2025Q2 and delete the self created 2025Q3. This hasn't work.
This created a new local branch. Switch to some other branch and delete it.

git checkout main
git branch -d 2025Q3
git pull -p
Then switch to the actual remote 2025Q3 branch:
git checkout 2025Q3 # Note this does NOT include the -b option. The -b is to 'checkout' and create a new local branch.
 
This created a new local branch. Switch to some other branch and delete it.

git checkout main
git branch -d 2025Q3
git pull -p
Then switch to the actual remote 2025Q3 branch:
git checkout 2025Q3 # Note this does NOT include the -b option. The -b is to 'checkout' and create a new local branch.
cd /usr/ports
git checkout main gives me
--> error: pathspec 'main' did not match any file(s) known to git
git checkout master too
--> error: pathspec 'main' did not match any file(s) known to git

update: I had done these to clone the repository
cd /usr/ports
rm -rf * and all point "." files
"To check out a copy of a quarterly branch:"
git clone --depth 1 https://git.FreeBSD.org/ports.git -b 2025Q2 /usr/ports
 
Did you initially do a so-called 'shallow' clone (--depth=1)? If so you can't switch to other branches. Well, technically you can but it's a bit of a pain to do. Doing a fresh new clone (not shallow!) is way simpler.
 
Did you initially do a so-called 'shallow' clone (--depth=1)? If so you can't switch to other branches. Well, technically you can but it's a bit of a pain to do. Doing a fresh new clone (not shallow!) is way simpler.
IIRC, you can also change the config in .git/config. Replace all 2025Q2 with 2025Q3s.

For example, my config in ports tree.
Code:
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = https://git.freebsd.org/ports.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "2025Q2"]
    remote = origin
    merge = refs/heads/2025Q2
[branch "main"]
    remote = origin
    merge = refs/heads/main
 
IIRC, you can also change the config in .git/config. Replace all 2025Q2 with 2025Q3s.

For example, my config in ports tree.
Code:
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = https://git.freebsd.org/ports.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "2025Q2"]
    remote = origin
    merge = refs/heads/2025Q2
 [branch "2025Q3"]
      remote = origin
      merge = refs/heads/2025Q3
[branch "main"]
    remote = origin
    merge = refs/heads/main
I have try this but
git branch gives only
* 2025Q2
and
git switch main

--> fatal: invalid reference: main

it don't see "main" or "2025Q3" branch - it seems this way it doesn't work
 
This created a new local branch. Switch to some other branch and delete it.

git checkout main
git branch -d 2025Q3
git pull -p
Then switch to the actual remote 2025Q3 branch:
git checkout 2025Q3 # Note this does NOT include the -b option. The -b is to 'checkout' and create a new local branch.
I have done this

cd /usr/ports
rm -rf */cmd]
[cmd]rm -rf .arcconfig .git .gitignore .hooks .mailmap && ll


git clone --branch main https://git.freebsd.org/ports.git /usr/ports
git pull -p

"Then switch to the actual remote 2025Q3 branch:"
git checkout 2025Q3
git branch
--> * 2025Q3
main

Test:
cat /usr/ports/www/p5-CGI/distinfo
--> (CGI-4.69.tar.gz)
git switch main
--> Switched to branch 'main'
Your branch is up to date with 'origin/main'.
cat /usr/ports/www/p5-CGI/distinfo
--> (CGI-4.70.tar.gz)
git switch 2025Q3
--> Switched to branch '2025Q3'
Your branch is up to date with 'origin/2025Q3'.
cat /usr/ports/www/p5-CGI/distinfo
--> (CGI-4.69.tar.gz)

=>OK!

make index
error: how ever ports "chinese" and "vietnamese" are broken for "make index"

make fetchindex
 
Back
Top