1

I have a new repository with no commits. I'm not having issues with files that were committed to git and moving them to lfs.

> git version
git version 2.39.3 (Apple Git-145)
> git lfs version            
git-lfs/3.6.1 (GitHub; darwin arm64; go 1.23.4)

This illustrates the problem.

> git init
> git lfs track "*.db"
> cat .gitattributes 
*.db filter=lfs diff=lfs merge=lfs -text
> git add .gitattributes
> git commit -m "init"
...
> git add mybigfile.db
> git lfs status
On branch main

Objects to be committed:

    mybigfile.db (Git: 09539d3)

Objects not staged for commit:


> git commit -m "add .db"
...
> git lfs ls-files
(nothing printed here)
> git remote add origin [email protected]:username/myrepo.git 
> git push -u origin main
Errors (large file must be on LFS etc)

remote: error: Trace: 8f76...
remote: error: See https://gh.io/lfs for more information.
remote: error: File mybigfile.db is 157.89 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
To github.com:username/myrepo.git
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'github.com:username/myrepo.git'

What I tried:

GIT_TRACE=1 git push (or GIT_CURL_VERBOSE=1);

20:43:44.031634 trace git-lfs: pure SSH connection unsuccessful (#0)
20:43:44.031676 trace git-lfs: pure SSH protocol connection failed (upload, origin): Unable to negotiate version with remote side (unable to read capabilities): EOF
Failed to connect to remote SSH server: Invalid command: git-lfs-transfer ThomasJannaud/app-langues.git upload
  You appear to be using ssh to clone a git:// URL.
  Make sure your core.gitProxy config option and the
  GIT_PROXY_COMMAND environment variable are NOT set.

ssh [email protected] "git-lfs-authenticate xxx/myrepo.git upload" returns a nice json with an authorization and http code 200

> git config --global url.https://github.com/.insteadOf git://github.com/

So somehow git push to github with lfs needs ssh, it says ssh is not working, and when I try in a separate command it works. Doing something very vanilla and following the instructions, I'm at a loss :( Any help greatly appreciated, thanks

Update:

> git remote -v     
origin  [email protected]:username/myrepo.git (fetch)
origin  [email protected]:username/myrepo.git (push)

> git config --list --show-origin
file:/Applications/Xcode.app/Contents/Developer/usr/share/git-core/gitconfig    credential.helper=osxkeychain
file:/Applications/Xcode.app/Contents/Developer/usr/share/git-core/gitconfig    init.defaultbranch=main
file:/Users/thomas/.gitconfig   user.name=Thomas
file:/Users/thomas/.gitconfig   user.email=myemail@...
file:/Users/thomas/.gitconfig   url.https://github.com/.insteadof=git://github.com/
file:.git/config        core.repositoryformatversion=0
file:.git/config        core.filemode=true
file:.git/config        core.bare=false
file:.git/config        core.logallrefupdates=true
file:.git/config        core.ignorecase=true
file:.git/config        core.precomposeunicode=true
file:.git/config        lfs.repositoryformatversion=0
file:.git/config        [email protected]:username/myrepo.git
file:.git/config        remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
file:.git/config        branch.master.remote=origin
file:.git/config        branch.master.merge=refs/heads/master
8
  • 1
    Errors (large file must be on LFS etc) We need to see the actual error message to help. Commented Apr 21 at 17:50
  • 1
    1) git remote add origin ...github... That is also very important information, what url did you use? 2) Objects to be pushed to origin/main: Are you sure git lfs status said it's going to push to origin/main before you set up the remote origin? Commented Apr 21 at 18:01
  • @Schwern thanks, edited the question ; to your second question, I pasted what git lfs status gives. Commented Apr 22 at 14:53
  • git push -u origin main connected and rejected the push because of a large file. But then you have GIT_TRACE=1 git push (note: not the same command) has a different error rejecting the connection with a url problem. That's odd. Could you show us git remote -v? Commented Apr 22 at 16:38
  • You've included git config --global url.https://github.com/.insteadOf git://github.com/ with no context. Is that in your config? I suspect that's what is causing "You appear to be using ssh to clone a git:// URL." Would you show us git config --list --show-origin? Be sure to sanitize any personal information. Commented Apr 22 at 16:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.