44

If I have git lfs installed on the client and I run:

git clone

is this equivalent to

git lfs clone

or will different results occur?

Thank you!

The answer to this question:

Can one clone a Git LFS repo without installing Git LFS?

seems to imply that git clone will work if you have git lfs installed. It isn't clear if this means that the two commands will work the same. Unfortunately my reputation is too low to comment and ask.

3 Answers 3

38

I updated the git client from 2.10.0 to 2.16.1 and it now says:

WARNING: 'git lfs clone' is deprecated and will not be updated
with new flags from 'git clone'

'git clone' has been updated in upstream Git to have comparable
speeds to 'git lfs clone'.

I suppose the answer is that git lfs clone is now pretty much the same thing as git clone and the separate command will disappear.

3
  • 6
    This doesn't work for me. Executing git clone on this repo: github.com/micasense/imageprocessing.git causes the images in data/ to not be downloaded correctly. Executing git lfs install and git lfs pull (after a standard git pull) cause the images to download properly.
    – Ring
    Commented Oct 17, 2019 at 4:18
  • 2
    git clone at git (Apple) v2.21.1 does not show me progress, making it impossible to tell if it is successful, while git lfs clone does
    – bunkerdive
    Commented Mar 27, 2020 at 22:37
  • Does one need to install git-lfs on the local machine, to use git clone if the remote repo has files stored in git lfs? Commented Aug 19, 2022 at 21:32
25

git lfs clone essentially runs the following sequence of commands (see #1973):

$ GIT_LFS_SKIP_SMUDGE=1 git clone [email protected]
$ cd something
$ git lfs pull

Notice, git lfs clone has been deprecated since Git LFS 2.3.0 (see #2526). Simply, use git clone.

2
7

Cloning at light speed with git lfs clone

A new feature you definitely want to take advantage of if you have a very large repository, and especially if you're on Windows, is the specialized LFS clone command:

git lfs clone ssh://[email protected]:7999/lfs/repo.git my-clone

The git lfs clone command operates exactly like git clone and takes all the same arguments, but has one important difference: it's a lot faster! Depending on the number of files you have it can be more than 10x faster in fact.

Read through this article to understand behind the scenes of git lfs clone vs git clone https://developer.atlassian.com/blog/2016/04/git-lfs-12-clone-faster/

3
  • When I watch the osx window even though I issued a git clone command I see the window title alternate from "ssh < git clone ssh://git@" to "git-lft < git clone ssh://git@". So it seems like git clone is "using" git-lfs even though I didn't explicitly tell it to. The output of git clone and git lfs clone is different though with git lfs showing more of a status bar for large packages and git clone showing each individual file. Your answer seems to indicate that git clone will be slower even though it is using git lfs? but that the results - the files will be exactly the same? Commented Jan 23, 2018 at 1:08
  • git: 'lfs' is not a git command. (git version 2.39.2 (Apple Git-143)) Commented Jul 1 at 20:30
  • After brew install git-lfs the git lfs command started working. Commented Jul 1 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.