Cannot push with SSH

Hello, created my first space (well, now second, since I deleted it and tried again, just to make sure) at Fastai Pet Classifier2 - a Hugging Face Space by Tannhorn and configured my git setup with SSH keys. I can clone the repo, execute e.g. git fetch (it asks for the .ssh key password) but when I try to push (no matter what, it can be just requirements.txt), it prompts me for the password but upon entering, it simply prompts again. git push -v does not give any more clues.

Thanks for any help!

hi @Tannhorn,

Please double check if you’ve cloned it via the git protocol

git clone git@hf.co:spaces/Tannhorn/fastai_pet_classifier2

You can also edit the .git/config file inside your local repo

Hello @radames, thank you for your reply!

This is the content of my .git/config:

[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
[remote "origin"]
	url = git@hf.co:spaces/Tannhorn/fastai_pet_classifier2
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
	remote = origin
	merge = refs/heads/main
[lfs]
	repositoryformatversion = 0

oh, that looks good! please make sure you SSH keys are set accordingly. You can always test it by running

$ ssh -T git@hf.co
> Hi ___ , welcome to Hugging Face.

This works. Actually, since you encouraged me that there is nothing wrong with my setup, I simply tried git push while entering the password again and again – and it turns out that by entering it three times in a row, the push goes through. In comparison, I only need to (as expected) enter it correctly once to execute git fetch or git pull.

1 Like