Git-lfs: Git-LFS PUSH fails , with a forked "brand new" repo

Created on 15 Aug 2016  路  3Comments  路  Source: git-lfs/git-lfs

[Easy Reproduce Step]

  1. fork a public repo from other people/organization( that repo is an empty repo, with only a README.md), git clone the forked repo (under my name) to my computer
  2. copy in a large file (example, a.img) ( it's 200MB)
  3. git lfs install
  4. git lfs track _.img
  5. git add .gitattr_ a.img
  6. git commit -m "add a.img"
  7. git push, and show below error ("git lfs push origin master" also gets the same effect )

[Error]
Git LFS: (0 of 1 files) 0 B / 199.15 MB
@panpan0000 can not upload new objects to public fork panpan0000/test
Docs: https://github.com/contact
@panpan0000 can not upload new objects to public fork panpan0000/test
Docs: https://github.com/contact
error: failed to push some refs to 'https://github.com/panpan0000/test.git'


My motivation is to create an Pull Request with large files to a repo.


[SW Versions]
OS: Ubuntu 14.04.2 LTS
git-lfs/1.3.1 (GitHub; linux amd64; go 1.6.3; git 9c9dffb)
git version 2.9.3


[important Tips]
if the original repo already contains at least one big-file, then the step (7) can be successful . (but the big-file was been pushed directly by owner, instead via a Pull Request by other people).

so in step (1) , the "empty" just an easy way for you to reproduce. I believe the issue exists when a repo never being push for big-images before.


[Tips-2]
I tried same thing with a private github enterprise, the error message is a bit different than Github.com:

Git LFS: (0 of 1 files) 398.31 MB / 199.15 MB
Not found
Request ID: b63c57e4-629d-11e6-8ded-22bb4fb7fd29
Not found
Request ID: b63c57e4-629d-11e6-8ded-22bb4fb7fd29
error: failed to push some refs to 'https://xxxxx/xxxx/xxxx.git'

  • @changev

Most helpful comment

See also #1906. IMHO this should not work like this, forks should be able to enable git-lfs, no reason it's only the top repo that can enable it. If I clone a repo, breaks the link to the origin and push as if it was my own repo, then I can enable git-lfs, that's ridiculous.

All 3 comments

@panpan0000 On GitHub.com, you can't push LFS assets to a public fork unless the original repo already has LFS objects, or you have push access to the original repo. This is a server side rule to prevent abuse. Once the public repository has LFS objects, anyone should be able to push LFS objects to their forks. If you see an issue here, let me know the repository fork and the owner trying to push so we can look into it.

You didn't print out enough data on your Enterprise error. I'll need to know:

  • Version of Enterprise
  • Does the repository have LFS access? This is controlled through the Enterprise admin tool.
  • Run git lfs env
  • Run the failing command with GIT_CURL_VERBOSE=1

I'd recommend sending this info to https://enterprise.github.com/support or https://github.com/support, since it can contain private details about your instance.

Hi, @technoweenie , Thank you so much for your response.
it's quite clear. I believe that the failure in GitHub Enterprise is due to same reason. because once the repo has LFS objects as you mentioned, then the pull to forked repo are all set.

Thank you very much !
BTW: I don't know if this is a normal senario and lots of people will meet it. if yes , then document this in FAQ may be helpful. because not all the time people who contribute a repo have directly push privillage and have to contribute via pull request.

See also #1906. IMHO this should not work like this, forks should be able to enable git-lfs, no reason it's only the top repo that can enable it. If I clone a repo, breaks the link to the origin and push as if it was my own repo, then I can enable git-lfs, that's ridiculous.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kervin521 picture kervin521  路  4Comments

pointcache picture pointcache  路  4Comments

pauljohn32 picture pauljohn32  路  3Comments

danielbayley picture danielbayley  路  4Comments

albasili picture albasili  路  3Comments