GIT-LFS-CLONE(1)
β¨ GIT-LFS-CLONE β¨
okay so bestie, this is a git-lfs manual page, and today's main character is git-lfs-clone β the one that slides into your DMs to clone a LFS-enabled repo without making you wait forever π
πΈ NAME πΈ
git-lfs-clone β clone a LFS-enabled repository, but likeβ¦ efficiently π
π SYNOPSIS π
git lfs clone [git clone options] <repository> [<directory>]
π DESCRIPTION π
So here's the tea β: this command clones an LFS enabled Git repository way more efficiently by disabling LFS during the git clone, and then immediately doing a git lfs pull right after. Two-step glow-up, no cap β¨
It also installs all of the repo-level hooks (.git/hooks) that LFS needs in order to operate β like, it's not just cloning, it's setting up the whole vibe. And if you pass --separate-git-dir, those hooks get installed there instead. iykyk π«Ά
Why is this faster than a regular git clone, you ask? Because a regular one downloads LFS content using the smudge filter, which runs individually per file in the working copy π that's lowkey inefficient compared to the batch mode and parallel downloads that git lfs pull does. It's giving "one person at the register" vs. "twelve lanes open at Target." ππ¨
β OPTIONS β
- all options supported by
git cloneβ yeah, literally every single one, they all work here, go wild π -I<paths>,--include=<paths> β see INCLUDE AND EXCLUDE down below, bestie π-X<paths>,--exclude=<paths> β also see INCLUDE AND EXCLUDE π--skip-repoβ skip installing the repo-level hooks (.git/hooks) that LFS requires. It's disabled by default, so this is you actively opting out. Bold move, respect π
π¦ INCLUDE AND EXCLUDE π¦
okay so you can configure Git LFS to only fetch objects that satisfy references in certain paths of the repo, and/or exclude certain paths, so you're not wasting your precious time downloading stuff you literally do not use. self-care fr fr πΈ
In your Git configuration or in a .lfsconfig file, you can set either or both of lfs.fetchinclude and lfs.fetchexclude to comma-separated lists of paths. Here's the vibe check on how that works:
- If
lfs.fetchincludeis defined, Git LFS objects will only be fetched if their path matches one in that list π₯ - If
lfs.fetchexcludeis defined, Git LFS objects will only be fetched if their path does not match one in that list π
Paths are matched using wildcard matching as per gitignore(5). iconic behavior.
heads up bestie π using the command-line options-Iand-Xoverrides the respective configuration settings. And setting either option to an empty string clears the value. so don't be surprised when your config gets ghosted π»
π SEE ALSO π
git-clone(1), git-lfs-pull(1), gitignore(5).
Part of the git-lfs(1) suite. you know, the whole fam π«Ά
and that's the whole page, bestie β no crumbs left behind π
this was GIT-LFS-CLONE(1) from the git-lfs suite, and the date on this beauty is the GIT-LFS-CLONE(1) footer situation at the bottom, so go forth and clone efficiently β¨π¦π
π¦ where this page comes from
- arch rolling: git-lfs 3.8.1-1 Β· MIT
- nixos 26.05: git-lfs 3.8.1
- nixpkgs unstable: git-lfs 3.8.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms