40

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.

Fresh Codemonger
  • 1,125
  • 1
  • 10
  • 20

3 Answers3

32

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.

João Pimentel Ferreira
  • 14,289
  • 10
  • 80
  • 109
Fresh Codemonger
  • 1,125
  • 1
  • 10
  • 20
  • 6
    This doesn't work for me. Executing git clone on this repo: https://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 Oct 17 '19 at 04: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 Mar 27 '20 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? – João Pimentel Ferreira Aug 19 '22 at 21:32
20

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

$ GIT_LFS_SKIP_SMUDGE=1 git clone git@something.something.git
$ cd something
$ git lfs pull

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

mloskot
  • 37,086
  • 11
  • 109
  • 136
  • 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? – João Pimentel Ferreira Aug 19 '22 at 21:32
  • 1
    @JoãoPimentelFerreira Yes, https://github.com/git-lfs/git-lfs/wiki/Tutorial#pulling-and-cloning "Once git lfs is installed, to clone an LFS repo, just run a normal git clone command..." – mloskot Aug 24 '22 at 11:01
5

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://git@mybb-server.com: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/

Nisse Engström
  • 4,738
  • 23
  • 27
  • 42
Pankaj Gadge
  • 2,748
  • 3
  • 18
  • 25
  • 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? – Fresh Codemonger Jan 23 '18 at 01:08