Solved how to install ports with git

Hi! , so time ago I was using ports-mgmt/portsnap but is deprecated (before bsd 14.1)

correct me if I'm wrong, the command is this :

git clone https://git.freebsd.org/ports.git /usr/ports

I admit that I ever use Git , so , my 2 questions

-Now I'm in 14.1-RELEASE , but I had to indicate with release I want to download or is automatic?
For example, not download the 14.0 ports
-How update the ports?

Thanks in advance
 
If you want to pull/clone faster, you can use --depth=1.

If you want to pull latest ports tree, you can pull main branch. If you want to pull quarterly branch, you can pull for example 2024Q2 branch.
Code:
# latest
git clone --depth=1 -b main https://git.freebsd.org/ports.git /usr/ports
# quarterly
git clone --depth=1 -b 2024Q2 https://git.freebsd.org/ports.git /usr/ports
To update the ports, you can pull updates using git pull.

Code:
# latest
git pull origin main
# quarterly
git pull origin 2024Q2
 
Now I'm in 14.1-RELEASE , but I had to indicate with release I want to download or is automatic?
There is only one ports tree. There are only two branches of interest, main is where everything happens, all the time, there's a continues stream of updates getting pushed to main. From main the latest packages are built. The other interesting branches are named 2024Q1, 2024Q2, etc., those are the quarterly branches, the quarterly packages are built from the <year>Q<#quarter> branches. The ports tree is not depended on the version or architecture of the OS. Specific ports may have such a dependency (graphics/drm-61-kmod for example needs 14.1+) but everything is still in one and the same ports tree.

-How update the ports?
cd /usr/ports ; git pull -p
 
Ok, I'm trying to do things in a simple way. If I want the main branch and always update that one, the following commands are right?

First time to get the (main branch) ports tree (equal to command portsnap fetch extract)
Code:
mkdir -p /usr/ports
git clone https://git.freebsd.org/ports.git /usr/ports

Updating the (main branch) ports tree (equal to command portsnap fetch update)
Code:
git pull https://git.freebsd.org/ports.git /usr/ports

or is better the command as sirdice shown?

Code:
cd /usr/ports ; git pull -p

P.S. I never used git, sorry
 
Back
Top