git: 50735390bd - main - handbook: Add git switch info for shallow clones
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 31 Aug 2025 18:54:55 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/doc/commit/?id=50735390bd3ed510a067085d617ba0e0d050b029
commit 50735390bd3ed510a067085d617ba0e0d050b029
Author: Sergei Zhmylev <zhmylove@narod.ru>
AuthorDate: 2025-01-19 14:10:40 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-08-31 18:54:28 +0000
handbook: Add git switch info for shallow clones
Signed-off-by: Sergei Zhmylev <zhmylove@narod.ru>
Reviewed-by: Warner Losh <imp@FreeBSD.org>
---
documentation/content/en/books/handbook/ports/_index.adoc | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/documentation/content/en/books/handbook/ports/_index.adoc b/documentation/content/en/books/handbook/ports/_index.adoc
index 725e00331c..a6e68a7137 100644
--- a/documentation/content/en/books/handbook/ports/_index.adoc
+++ b/documentation/content/en/books/handbook/ports/_index.adoc
@@ -730,8 +730,8 @@ If more control over the ports tree is needed or if local changes need to be mai
Git can be used to obtain the Ports Collection.
Refer to extref:{committers-guide}[the Git Primer, git-primer] for a detailed description of Git.
-We add --depth 1 to the git command line to clone the tree without obtaining the commit history, which saves time and is acceptable for most users.
-When maintaining custom changes to the ports tree, or need the history for any reason, omit the --depth 1 argument below.
+We add `--depth 1` to the git command line to clone the tree without obtaining the commit history, which saves time and is acceptable for most users.
+When maintaining custom changes to the ports tree, or need the history for any reason, omit the `--depth 1` argument below.
. Git must be installed before it can be used to check out the ports tree. If a copy of the ports tree is already present, install Git like this:
+
@@ -773,7 +773,8 @@ If the ports tree is not available, or pkg is being used to manage packages, Git
+
[source,shell]
....
-# git -C /usr/ports switch 2023Q1
+# git -C /usr/ports fetch --depth 1 origin 2023Q2:2023Q2
+# git -C /usr/ports switch 2023Q2
....
****