Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handbook: Add git switch info for shallow clones #459

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading