0

I have been pushing png and image files fine to github. Now, I get an error.

My set up: Windows + Visual Studio Code + git bash for terminal

This is my .git/config file

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
[credential]
    helper = store
[lfs "https://github.com/ryan/restart.git/info/lfs"]
    locksverify = false
[remote "origin"]
    url = https://github.com/ryan/restart.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
    remote = origin
    merge = refs/heads/main

So I add an image to my repository.

I do

git add .
git commit
git push

This is what git push results:

guestaccount@LAPTOP-4G5S6I9K MINGW64 /c/xampp7.2/htdocs/folder2-temp (main)
$ git push
Enter passphrase for key '/c/Users/guestaccount/.ssh/id_rsa': 
Uploading LFS objects:   0% (0/1), 0 B | 0 B/s

I always seem to get stuck here then this shows:

$ git push
Enter passphrase for key '/c/Users/guestaccount/.ssh/id_rsa': 
batch request: ssh: connect to host github.com port 22: Connection timed out: exit status 255
error: failed to push some refs to 'ssh://github.com/ryan/restart.git'

I have been asking how to switch from SSH to https in order to solve the problem, but it seems that's not the issue.

Cannot reset github from ssh to https

So, basically how do I upload png files again? This particular png file is only 46KB so github should be able to push it.

d7l2k4
  • 175
  • 1
  • 2
  • 14
  • 1
    This looks like an authentication problem, plain and simple. Can you push _anything_ to this repo? It sounds like you have not shared your public key with the remote server. (And it seems to me very dubious that if you're on a "guest account" you would have any SSH access to anything.) – matt Apr 25 '21 at 05:25
  • Thank you for responding. I titled my account (on Windows my laptop) guest account. But it has administrator privileges. I have been able to push almost everything else to github except for png files. When I push png files or images it gets stuck at "Uploading LFS objects: 0% (0/1), 0 B | 0 B/s" then returns an error like discussed above. – d7l2k4 Apr 25 '21 at 05:27
  • non images are pushed quickly and efficiently. Before I was able to upload images too. So far I have uploaded 94 commits. Someone had a prestashop site live and wanted me to put it on github. So I have been uploading slowly. Almost everything else is uploaded except a few images. – d7l2k4 Apr 25 '21 at 05:30
  • 1
    I don't know LFS but maybe all images are now going to the LFS server, and that's the one you have not authenticated to. – matt Apr 25 '21 at 05:31
  • Thank you. How would I fix that? – d7l2k4 Apr 25 '21 at 05:32
  • 1
    I don't know, but in your previous q. you quoted Git as saying `Permission denied (publickey)`, which sounds to me like you're talking to a server that doesn't know your public key. – matt Apr 25 '21 at 05:38
  • I'm so confused. So github knows my public key but LFS does not? I guess I have to authenticate SSH to LFS server. Just don't know how. Thank you matt – d7l2k4 Apr 25 '21 at 05:53
  • 1
    I don't know either; I don't know where the LFS server is. But I believe the point of LFS is that some files live elsewhere, namely the LFS server. This is all just guesswork on my part, based on the info you've given. – matt Apr 25 '21 at 06:07
  • How would I disable LFS? – d7l2k4 Apr 25 '21 at 21:46
  • 1
    https://stackoverflow.com/questions/48699293/how-to-i-disable-git-lfs – matt Apr 25 '21 at 21:50
  • Thank you. I will give that a try. I do appreciate your time and have upvoted all your answers, if that helps in any way. – d7l2k4 Apr 25 '21 at 21:51
  • No need for that; these are comments, not answers, and we are just chatting. Remember, I know nothing of LFS. – matt Apr 25 '21 at 21:59

1 Answers1

0

I encountered the same issue (stuck on "Uploading LFS objects"). Further investigating, setting the environment variables GIT_TRACE=1 and GIT_TRANSFER_TRACE=1.

I noticed that the git is stuck at the following:

run_command: C:\WINDOWS\System32\OpenSSH\ssh.exe -- git@my-git-domain.com git-lfs-authenticate my-git-repository.git upload
trace git-lfs: exec: C:\WINDOWS\System32\OpenSSH\ssh.exe '--' 'git@my-git-domain.com' 'git-lfs-authenticate my-git-repository.git upload'

Surprisingly, running the following command successfully returned and displayed my authorization header.

C:\WINDOWS\System32\OpenSSH\ssh.exe -- git@my-git-domain.com git-lfs-authenticate my-git-repository.git upload

Turns out that the shipped Win10 ssh client has a bug and downloading a new version and setting the following environment variable resolved the issue.

GIT_SSH=C:\MyPath\to\the\new\ssh.exe
ScrambledRK
  • 334
  • 1
  • 4