Skip to content

Commit

Permalink
handbook: Add git switch info for shallow clones
Browse files Browse the repository at this point in the history
Signed-off-by: Sergei Zhmylev <[email protected]>
  • Loading branch information
zhmylove committed Jan 19, 2025
1 parent 7379d27 commit 940cd4f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions documentation/content/en/books/handbook/ports/_index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,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.
If you have your own 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.
If you have your own 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:
+
Expand Down Expand Up @@ -726,7 +726,15 @@ 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 switch 2023Q2
....
+
If the ports tree is cloned with `--depth 1`, make sure to fetch the desired branch in advance:
+
[source,shell]
....
# git -C /usr/ports fetch --depth 1 origin 2023Q2:2023Q2
# git -C /usr/ports switch 2023Q2
....
****

Expand Down

0 comments on commit 940cd4f

Please sign in to comment.