git: 50735390bd - main - handbook: Add git switch info for shallow clones

Warner Losh <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/doc/commit/?id=50735390bd3ed510a067085d617ba0e0d050b029

commit 50735390bd3ed510a067085d617ba0e0d050b029
Author:     Sergei Zhmylev <[email protected]>
AuthorDate: 2025-01-19 14:10:40 +0000
Commit:     Warner Losh <[email protected]>
CommitDate: 2025-08-31 18:54:28 +0000

    handbook: Add git switch info for shallow clones
    
    Signed-off-by: Sergei Zhmylev <[email protected]>
    Reviewed-by: Warner Losh <[email protected]>
---
 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
 ....
 ****
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.