Skip to content
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

How to download files when git-lfs was installed after git clone #325

Closed
mnapoli opened this issue May 22, 2015 · 12 comments
Closed

How to download files when git-lfs was installed after git clone #325

mnapoli opened this issue May 22, 2015 · 12 comments

Comments

@mnapoli
Copy link

mnapoli commented May 22, 2015

  • git-lfs is not installed
  • clone a repository containing large files (i.e. using git-lfs)
  • large files are actually text pointers (OK)
  • install git-lfs

-> large files are still text pointers

How can I "refresh" my local repository so that git-lfs replaces the text pointers with the actual files?

This is especially problematic on Travis: the repository is cloned before everything, so I have to install git-lfs and then somehow refresh the repository. I have tried many things (init, pull, checkout, …) without success…

@rubyist
Copy link
Contributor

rubyist commented May 22, 2015

Sorry for the trouble, right now it's a little inelegant. One way around it is to just remove the pointer files then do a git checkout . after git-lfs is installed and that should run them through the filters and cause them to download and update.

We're adding a command that will fix this exact scenario in #285. Once that lands, you'll be able to just run git lfs get and the objects will be refreshed.

@mnapoli
Copy link
Author

mnapoli commented May 22, 2015

Great, as long as we have a workaround that should do it. Testing it straightaway and then I'll close.

@mnapoli
Copy link
Author

mnapoli commented May 22, 2015

Works!

@mnapoli mnapoli closed this as completed May 22, 2015
@mnapoli
Copy link
Author

mnapoli commented Jul 20, 2015

Update for those interested: since v0.5.2 git lfs fetch does the job!

@stevendlander
Copy link

I am still experiencing this issue, even with git lfs fetch, on a Travis-CI container. I install git-lfs and then run git lfs fetch, however I get the following error:

Invalid status for POST https://github.com/{myaccount}/{myrepo}.git/info/lfs/objects/batch: 403

My two files are never downloaded. This is using git-lfs-1.0.0

@technoweenie
Copy link
Contributor

Another update: git lfs pull is now the correct command, as of Git LFS v0.6.0. fetch will download the files, but pull updates them in the working directory.

@stevendlander: You're hitting an Unauthorized response from your Git LFS server. Contact GitHub at https://github.com/contact with details from these commands:

$ git lfs env
$ GIT_CURL_VERBOSE=1 git lfs fetch

Be sure to sanitize any "Authorization: Basic ...." lines in the output.

@ramv-dailymotion
Copy link

git lfs fetch doesn't work for me :(

root@ahaury:~/data/rc-recommend# git lfs fetch
Fetching dev-v2
Git LFS: (0 of 1 files) 0 B / 512.00 MB                                                                               
Git LFS: (0 of 1 files) 0 B / 512.00 MB                                                                               root@ahaury:~/data/rc-recommend# git lfs env
git-lfs/1.1.0 (GitHub; linux amd64; go 1.5.1)
git version 2.3.5

Endpoint=https://github.com/dailymotion/rc-recommend.git/info/lfs (auth=basic)
LocalWorkingDir=/data/rviswanadha/data/rc-recommend
LocalGitDir=/home/rviswanadha/data/rc-recommend/.git
LocalGitStorageDir=/home/rviswanadha/data/rc-recommend/.git
LocalMediaDir=/home/rviswanadha/data/rc-recommend/.git/lfs/objects
TempDir=/home/rviswanadha/data/rc-recommend/.git/lfs/tmp
ConcurrentTransfers=3
BatchTransfer=true
git config filter.lfs.smudge = "git-lfs smudge %f"
git config filter.lfs.clean = "git-lfs clean %f"
root@ahaury:~/data/rc-recommend#  GIT_CURL_VERBOSE=1 git lfs fetch
Fetching dev-v2
Git LFS: (0 of 1 files) 0 B / 512.00 MB                                                                               
Git LFS: (0 of 1 files) 0 B / 512.00 MB                                                                               root@ahaury:~/data/rc-recommend# 

@technoweenie
Copy link
Contributor

Hi @ramv-dailymotion, can you open a new issue describing what you expected to happen? If you could include the output of GIT_TRACE=1 git lfs fetch, that'd be great.

@jonadiazz
Copy link

For those still trying to figure out the problem it might have to do with your storage or bandwidth plan.

Check under: Settings > Billing > Billing Overview

If you are using Git LFS you might need to "Purchase more"

@qwertzguy
Copy link

git lfs pull didn't work for me. Got the error of #937. I had to use the first solution given here, that is remove all the files handled by git LFS, found by cat .gitattributes, and run git checkout .

@pointcache
Copy link

How is this closed? its bugged as hell and impossible to properly setup a repo

@technoweenie
Copy link
Contributor

The original submitter closed this issue. Please open a new one with detailed instructions describing your specific bug. Thanks! Locking this old thread.

@git-lfs git-lfs locked and limited conversation to collaborators Nov 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants