-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
None
When git checkout is invoked on a LFS repository it will call the LFS smudge filter once per LFS file being checkedout.
Normally this is ok, it reads the file contents from .git/lfs/objects, however if the file isn't stored locally, it needs to fetch it from the remote.
The process per file is
- Request the download URL over HTTP(S) from the remote.
- Download the file from the LFS store.
However if the remote is SSH the process is far worse because theres a bonus step that the start
- Request a Auth token over SSH
- Using the auth token request the download URL over HTTP(S) from the remote.
- Download the file from the LFS store.
Because of this each file can start taking multiple seconds to checkout.
If Sourcetree could call git lfs fetch <branch_name> before checkout then all the files that will be required for this checkout could be downloaded in parallel with a single call to get download URLs for all the files at once.
Workarounds
If you are experiencing this issue there are a couple of things you can do to improve your speeds.
If you are using a SSH remote switching to a HTTPS remote will improve your checkout times massively as you eliminate the extremely costly SSH step.
If you are using HTTP(S) Remote you can open a terminal and run git lfs fetch <branch_name> before you checkout using Sourcetree and the checkout won't have to interact with the remote server at all.