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

Proposal: Partial clone #1597

Open
bagasme opened this issue Jan 27, 2021 · 2 comments · May be fixed by #1611
Open

Proposal: Partial clone #1597

bagasme opened this issue Jan 27, 2021 · 2 comments · May be fixed by #1611

Comments

@bagasme
Copy link
Contributor

bagasme commented Jan 27, 2021

I proposed to add discussion about partial clone (blobless, treeless, and shallow clones) to the book.

For the text, it can be inspired from this GitHub blog post.

In summary:

When you want to clone a repository, but you don't want full clone (for example because you're on metered internet connection), Git provides three ways to get partial clone:

  1. git clone --filter=blob:none <url> - blobless clone. Trees and commits are downloaded, but blobs are downloaded on-demand after checkout. Recommended for developers
  2. git clone --filter=tree:0 <url> - treeless clone. Only commits are downloaded. Blobs and trees are downloaded on-demand. Recommended for CI builds that needs access to commit history
  3. git clone --depth=1 <url> - shallow clone. Download commit history until specified depth level (roughly corresponds to number of commits), in this case 1 commit. Recommended for CI builds.
@HonkingGoose
Copy link
Contributor

That post is very nice indeed! So why not just link to the post instead of writing something up ourselves?
That saves us the work of writing something up without straight up plagiarizing their work. 😄

Also I'm not sure if providing too much help on partial clones is actually helpful for most normal users?
Relevant quote from the GitHub blog (bold emphasis mine!):

Git’s partial clone and shallow clone features are options that can help here, but they come with their own tradeoffs. Each option breaks at least one expectation from the normal distributed nature of Git, and you might not be willing to make those tradeoffs.

So if we're going to write something about partial clones, we should cover that in warnings: "For advanced users only, for normal use just do a normal git clone." and so on.

@bagasme
Copy link
Contributor Author

bagasme commented Feb 10, 2021

@HonkingGoose ok

@bagasme bagasme linked a pull request Feb 15, 2021 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants