New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download LFS assets automatically or not #720

Closed
swolfish opened this Issue Oct 8, 2015 · 6 comments

Comments

Projects
None yet
4 participants
@swolfish
Copy link

swolfish commented Oct 8, 2015

Can it be LFS configured in some way to choose between automatically and manually download assets by cloning git repo?
In my case, by cloning project git repo it starts to download LFS assets immediately and the problem is if user has't configured credentials caching before so download prompts username and password for each asset specifically.
After clone, I want to execute bash script first (to cache credentials) then git lfs pull to download assets.
Also, maybe I want option to checkout only the project code if don't need assets in the moment (maybe they are too large and wasting of resources).

@sinbad

This comment has been minimized.

Copy link
Contributor

sinbad commented Oct 9, 2015

Yes, define GIT_LFS_SKIP_SMUDGE=1 at clone time and downloading LFS files will be skipped. You can then use git lfs pull to download LFS files.

@swolfish

This comment has been minimized.

Copy link
Author

swolfish commented Oct 9, 2015

OK, thanks, this works fine. But it would be great that some default LFS properties are inside project itself (like lfs url in .gitconfig) and then the end user shouldn't use some non intuitive commands by cloning the project. Is that maybe gonna be possible in some future releases?

@sinbad

This comment has been minimized.

Copy link
Contributor

sinbad commented Oct 13, 2015

You can set this option globally by doing git lfs init --skip-smudge which means the smudge filter is turned off completely and you have to always use git lfs pull to download & check out large files. (edit) This disables the smudge filter globally. We're also discussing the option of having wrapper commands for operations like git clone where we can optimise the download and provide more options.

@lbergelson

This comment has been minimized.

Copy link

lbergelson commented Oct 13, 2015

I agree with @swolfish that it would be very useful to be able to define this within the project itself.

@technoweenie

This comment has been minimized.

Copy link
Member

technoweenie commented Oct 13, 2015

Git doesn't read .gitconfig by default, so this is something you'll have to do manually with git config.

# from your repository working directory:
$ git config filter.lfs.smudge "git-lfs smudge --skip %f"

This will save it to .git/config.

@technoweenie

This comment has been minimized.

Copy link
Member

technoweenie commented Aug 18, 2016

You can now run git lfs install --local to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment