Git - devel/git

Beginning with FreeBSD 14.0, the recommended method to acquire and update the ports tree is with Git.

FreeBSD has provisioned a Git mirror for 'ports, source, and documentation' at https://cgit.freebsd.org/

 

Initial Git Clone of the Ports Tree

After installing devel/git, ensure that /usr/ports/ is entirely empty.

To initially clone the ports tree via anonymous ssh://, execute the following command:

git clone ssh://anongit@git.FreeBSD.org/ports.git /usr/ports/

If it is the first SSH connection from this host to git.freebsd.org, then answer yes at the prompt, to add the server's host public keys to .ssh/known_hosts and continue connecting.

The authenticity of host 'git.freebsd.org (2001:500:6b:d::24ca:1)' can't be established.
ED25519 key fingerprint is SHA256:y1ljKrKMD3lDObRUG3xJ9gXwEIuqnh306tSyFd1tuZE.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'git.freebsd.org' (ED25519) to the list of known hosts.

NOTE: Git network connectivity via ssh:// is far more reliable than https://. This appears to be true whether it's github.com or FreeBSD's Git mirror.

If preferred, the command to clone the ports tree via https:// is:

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

 

Update the Ports Tree Via Git

After the initial git clone, the ports tree can be updated with the following command:

git -C /usr/ports pull


The connection method will be the same as was used during the initial clone.