Can't Push to New Space

I am facing the same issue as well. I tried both approaches.

(1) Change url in .git/config to url = https://USER:TOKEN...' (2) Change url in .git/config to 'url = git@hf.co:spaces...

Both gave errors.

hi @subhankarfynd and @subhankarfynd

if you’re using SSH you can check if the authentication by calling

ssh -T git@hf.co
Hi radames, welcome to Hugging Face.

If that works for you, then you might have another issue on your repo, for instance we don’t allow large files on the git history, only LFS files.

Hi @radames . I get the following output:

Hi anonymous, welcome to Hugging Face.

Its saying “anonymous” rather than subhankarfynd Is that an issue?

Ok. I managed to git push to the space. There seems to be some issue with osxkeychain. I ran the following commands to erase the existing token/password in osxkeychain:

git credential-osxkeychain erase ⏎
host=huggingface.co ⏎
protocol=https⏎
⏎
⏎

Where ⏎ is Enter

2 Likes

oh great tip @subhankarfynd !

IDK you could do git credential-osxkeychain erase !!

My ssh authentication has just stopped working. I’m using Ubuntu - I set up SSH a while ago and it’s always worked fine but suddenly today I’m having auth issues

If I try and add my public key (Git over SSH) it says its already added, and if I try ssh -T git@hf.co it returns

Hi anonymous, welcome to Hugging Face.

I’ve had to switch back to HTTP using my token in order to get access my repo

Linux user here (Pop OS). I fixed my issue with pushing with SSH by editing the .git/config file to:

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

I then made sure the git remote was set to the url above:

git remote set-url origin git@hf.co:spaces/tstcoi/test

Thanks @radames !

1 Like

If I try and add my public key (Git over SSH) it says its already added, and if I try ssh -T git@hf.co it returns
Hi anonymous, welcome to Hugging Face.

I stumbled upon the same issue.
To troubleshot, i can recommend to run:

ssh -T git@hf.co -v

which will output, which key is picked up by ssh. To fix this, you can either try to fiddle around with your .ssh/config or simply add the public key to hf.co which is used by ssh.

1 Like