Cloning a repository with many files tracked by git-lfs is extremely slow
What steps will reproduce the problem?
- Install git-lfs
- Create a repository with a few thousand files tracked by git-lfs. My repository has a lot of small (5KB-1MB) image files.
- Clone the repository using TortoiseGit
What is the expected output? What do you see instead?
I expect the clone to be fast because git-lfs has a built-in command called "git lfs clone" that eliminates the overhead of downloading large files one at a time. Instead, I see that files are downloaded one at a time which is extremely slow on Windows (1-2 seconds per file).
What version of TortoiseGit and Git are you using? On what operating system?
TortoiseGit 2.3.0.0
Git 2.9.0
git-lfs 1.4.4
Windows 7
Please provide any additional information below.
There are some workarounds. One workaround is to completely disable git-lfs before cloning (git lfs install --skip-smudge
) so that TortoiseGit ignores files tracked by git-lfs during the clone operation. After the clone finishes, I have to manually run git lfs pull
in the cloned repository and then re-enable git lfs using git lfs install --force
.
Another workaround is to run this command from Git Bash: git lfs clone <url> <directory>