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
Hope git-lfs can clone repo without downloading real files. #227
Comments
Thanks for the idea. This is something we've been kicking around that we're calling "narrow clones." We want a way to specify what paths a user downloads via Git LFS. Right now, it's ALL PATHS. I'm not sure what this will look like yet, though. |
This would be great and I would propose to use NO PATHS as default. The corresponding git repo contains only pointers to the data files and I would suspect to get only those files.
|
I'm not sure we'll change the default, but I want the config to be saved in the repo (like |
That's a good idea as it will be also important for setting the lfs server url. |
@hagenw You can write a setting to a local
We should probably explain this better in the docs. |
@technoweenie Does this help cloning when I have a different url for git repo and lfs.url? The only thing I have found that works is
But
Still errors with "fatal: destination path '.' already exists and is not an empty directory." on git version 2.4.0 |
@andyneff The The error message looks like a git clone message and unrelated to Git LFS. Are you sure you're cloning to a new directory? |
I was doing it backwards (I didn't make .gitconfig part of the repo. I was trying to clone into a directory containing .gitconfig which I knew felt wrong). I see what you are saying now. Works perfectly! Thanks @technoweenie |
git-annex works this way: when you clone repository, you get only symlinks to the unexisted real files, then you get all the needed binary files As for Git LFS, I found only this workaround: do not push .gitattributes to the repository. In that case when repository is cloned, you get only links to real files, and then you may get it with git lfs pull, but when you get the real files, Git will treat it as a file replacement. IMHO this is important LFS drawback comparing to git-annex, I hope it will be resolved |
I'm sorry to drag this up again, but I don't think this solves the problem. Say I have a repo and I want its default behavior to be not to download the files when cloned, even if git lfs is installed- how do I do that? I'm guessing that there would have to be a file in the repo itself to tell git lfs to not download the files or be part of the .gitattibutes file? |
Sorry, figured it out. For completeness- if you want to not have the repo auto get everything you have to add a .lfsconfig file in the repo with fetchexclude=* |
You can also run any of the LFS "download" commands ( More information about this can be found in the manpages. |
It seems (Edit: It seems I used a too old version of git, not too new.) |
|
`git lfs clone` is still present in the latest versions.
Right, and eventually (as brian notes) we'll remove 'git lfs clone'
entirely and encourage users to use 'git clone' instead.
To emulate the `-X` (or '--exclude') behavior from 'git lfs clone' in
'git clone', you have a couple of options:
- Set 'GIT_LFS_SKIP_SMUDGE=1' in your environment, to skip the
"smudging" process entirely.
This means that 'GIT_LFS_SKIP_SMUDGE=1 git clone ...' is
behaviorally equivalent to 'git lfs clone --exclude="*" ...'.
- Set 'lfs.fetchexclude' in your Git configuration to be a comma-
separated list of patterns to exclude.
This means that 'git -c "lfs.fetchexclude=*" clone ...' is
behaviorally equivalent to 'git lfs clone --exclude="*" .' It also
has the benefit of being able to set more (1) fine grained patterns,
and (2) _also_ set `lfs.fetchinclude`, which corresponds to
'--include'.
|
I wonder if is possible?
In fact, git-lfs already made git repo thiner and lighter, I wonder if we can cloning repo without downloading the real files, 'cause the files we want to let git-lfs handle should be binaries or other large and static files, we may not need to edit them all, so if we can just leave them as pointers, I think it'll be awesome! Thanks.
The text was updated successfully, but these errors were encountered: