Users may prefer to use `freebsd-update` (crossref:cutting-edge[updating-upgrading-freebsdupdate,“FreeBSD Update”]) to update the FreeBSD base system, and `portsnap` (crossref:ports[ports-using,“Using the Ports Collection”]) to update the FreeBSD Ports Collection.
====
-This section demonstrates how to install Git on a FreeBSD system and use it to create a local copy of a FreeBSD repository.
-Additional information on the use of Git is included.
+This section demonstrates how to install Git on a FreeBSD system and use it to create a local copy of a FreeBSD source code repository.
[[git-install]]
=== Installation
-Git can be installed as a package:
+Git can be installed from the Ports Collection, or as a package:
[source,shell]
....
# pkg install git
....
-Git can also be installed from the Ports Collection:
-
-[source,shell]
-....
-# cd /usr/ports/devel/git
-# make install clean
-....
-
[[git-usage]]
=== Running Git
-To fetch a clean copy of the sources into a local directory, use `git`.
+To fetch a clean copy of the sources into a local directory, use `git clone`.
This directory of files is called the _working tree_.
-[WARNING]
-====
-
-Move or delete an existing destination directory before using `git clone` for the first time.
-Cloning over an existing non-git directory will fail.
-====
-
-Git uses URLs to designate a repository, taking the form of _protocol://hostname/path_.
-The first component of the path is the FreeBSD repository to access.
+Git uses URLs to designate a repository.
There are three different repositories, `src` for the FreeBSD system source code, `doc` for documentation, and `ports` for the FreeBSD Ports Collection.
-For example, the URL `https://git.FreeBSD.org/src.git` specifies the main branch of the src repository, using the `https` protocol.
+All three are reachable over two different protocols: HTTPS and SSH.
+For example, the URL `https://git.FreeBSD.org/src.git` specifies the main branch of the `src` repository, using the `https` protocol.
-* _repo_ is one of the Project repositories: `src`, `ports`, or `doc`.
-* _branch_ depends on the repository used.
-`ports` and `doc` are mostly updated in the `main` branch, while `src` maintains the latest version of -CURRENT under `main` and the respective latest versions of the -STABLE branches under `stable/12` (12._x_) and `stable/13` (13._x_).
-* _wcdir_ is the target directory where the contents of the specified branch should be placed.
-This is usually [.filename]#/usr/ports# for `ports`, [.filename]#/usr/src# for `src`, and [.filename]#/usr/doc# for `doc`.
-* _freebsd_ is the name of the origin to use.
-By convention in the FreeBSD documentation, the origin is assumed to be `freebsd`.
-
-This example checks out the `main` branch of the system sources from the FreeBSD repository using the HTTPS protocol, placing the local working copy in [.filename]#/usr/src#.
-If [.filename]#/usr/src# is already present but was not created by `git`, remember to rename or delete it before the checkout.
-Git will refuse to do anything otherwise.
+To clone a copy of the FreeBSD system source code repository:
The main mailing list for general usage and questions about git in the FreeBSD project is https://lists.freebsd.org/subscription/freebsd-git[freebsd-git].
For more details, including commit messages lists, see the crossref:handbook/eresources[eresources-mail, Mailing Lists] chapter.
+=== SSH host keys
+
+* gitrepo.FreeBSD.org host key fingerprints:
+** ECDSA key fingerprint is `SHA256:seWO5D27ySURcx4bknTNKlC1mgai0whP443PAKEvvZA`
+** ED25519 key fingerprint is `SHA256:lNR6i4BEOaaUhmDHBA1WJsO7H3KtvjE2r5q4sOxtIWo`
+** RSA key fingerprint is `SHA256:f453CUEFXEJAXlKeEHV+ajJfeEfx9MdKQUD7lIscnQI`
+
+* git.FreeBSD.org host key fingerprints:
+** ECDSA key fingerprint is `SHA256:/UlirUAsGiitupxmtsn7f9b7zCWd0vCs4Yo/tpVWP9w`
+** ED25519 key fingerprint is `SHA256:y1ljKrKMD3lDObRUG3xJ9gXwEIuqnh306tSyFd1tuZE`
+** RSA key fingerprint is `SHA256:jBe6FQGoH4HjvrIVM23dcnLZk9kmpdezR/CvQzm7rJM`
+
+These are also published as SSHFP records in DNS.