Added my SSH key, cannot push to Spaces repo
Hello, this is my first time using HuggingFace (I’ve been using GitHub for a long time), and I’m super excited to push code repos with live examples!I added my SSH key in settings, but it will not let me push to my new Spaces repo.Here’s my new account:trusktr (Joe Pea)I can verify that SSH works, like so:$ ssh git@hf.co
PTY allocation request failed on channel 0
Hi anonymous, welcome to Hugging Face.
Connection to hf.co closed.(It says “anonymous”, does that indicate an problem inside HF?)I created my first Space here:huggingface.coLume - a Hugging Face Space by lume-creativeGPU-powered 3D HTML. ✨🧊 <lume-box size="1 2 3">When I try to push to this repo, I get this:$ git remote -v
hf      git@hf.co:spaces/lume-creative/lume (fetch)
hf      git@hf.co:spaces/lume-creative/lume (push)

$ git push hf develop
remote: 
remote: ========================================================================
remote: 
remote: ERROR: This action requires authentication.
Make sure your SSH public key is linked with your profile on huggingface.co.
See https://huggingface.co/settings/keys.

remote: 
remote: ========================================================================
remote: 
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.It seems like there’s a bug in HF, because thesshtest works (but tells me I am anonymous), so the key is accepted, but I am not recognized as the owner of my SSH key.I’ve logged in withhuggingface-clibut no luck. Here’shuggingface-cli env:$ huggingface-cli env
/Users/trusktr/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(

Copy-and-paste the text below in your GitHub issue.

- huggingface_hub version: 0.26.5
- Platform: macOS-15.0.1-arm64-arm-64bit
- Python version: 3.9.6
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Running in Google Colab Enterprise ?: No
- Token path ?: /Users/trusktr/.cache/huggingface/token
- Has saved token ?: True
- Who am I ?: trusktr
- Configured git credential helpers: osxkeychain
- FastAI: N/A
- Tensorflow: N/A
- Torch: N/A
- Jinja2: N/A
- Graphviz: N/A
- keras: N/A
- Pydot: N/A
- Pillow: N/A
- REDACTED_TOKEN: N/A
- gradio: N/A
- tensorboard: N/A
- numpy: N/A
- pydantic: N/A
- aiohttp: N/A
- ENDPOINT: https://huggingface.co
- HF_HUB_CACHE: /Users/trusktr/.cache/huggingface/hub
- HF_ASSETS_CACHE: /Users/trusktr/.cache/huggingface/assets
- HF_TOKEN_PATH: /Users/trusktr/.cache/huggingface/token
- HF_STORED_TOKENS_PATH: /Users/trusktr/.cache/huggingface/stored_tokens
- HF_HUB_OFFLINE: False
- HF_HUB_DISABLE_TELEMETRY: False
- HF_HUB_DISABLE_PROGRESS_BARS: None
- HF_HUB_DISABLE_SYMLINKS_WARNING: False
- HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False
- HF_HUB_DISABLE_IMPLICIT_TOKEN: False
- HF_HUB_ENABLE_HF_TRANSFER: False
- HF_HUB_ETAG_TIMEOUT: 10
- HF_HUB_DOWNLOAD_TIMEOUT: 10After logging in withhuggingface-cli, I get the same error as above when Igit push. But I think that makes sense, asgitis simply using SSH.
2024-12-16T01:47:59Z
Looks like someone else has the exact same issue here, with no answer:Issue with SSH keys - always anonBeginnersHi there, I hope that everyone is doing well.  I’m wondering if anybody else has run into this? I’ve been trying to setup my ssh keys so that I can clone spaces etc. directly via ssh and not have to input my token everytime I want to push via HTTP. 
I’ve generated the appropriate keys, and have added the .pub file contents to my account under the SSH keys section.  This all seems to go well. 
When I try to run 
ssh -T git@hf.co

I still get the output 
Hi anonymous, welcome to Hugging Face.

if …
2024-12-16T02:29:24Z
Similar issue:Can't Push to New SpaceSpacesI’m getting the following errors when trying to push to my new space for the first time. 
remote: -------------------------------------------------------------------------
remote: You are not authorized to push to this repo.
remote: Make sure that you are properly logged in.
remote: -------------------------------------------------------------------------
To https://huggingface.co/spaces/Grokgpt/grokgpt
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs …
2024-12-16T03:02:03Z
I tried erasing macOS ssh credential as described here:Can't Push to New SpaceSpacesOk. 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 EnterBut no luck.
2024-12-16T03:08:18Z
@not-lainssh issue.
2024-12-16T03:14:05Z
I managed to get git to connect by using the HTTPS remote URL format withuser:token.[remote "hf"]
	url = https://trusktr:<TOKEN>@huggingface.co/spaces/lume-creative/lume
	fetch = +refs/heads/*:refs/remotes/hf/*However, now when I try to push, it fails:❯ git push --recurse-submodules=no hf develop
Enumerating objects: 18207, done.
Counting objects: 100% (18207/18207), done.
Delta compression using up to 8 threads
Compressing objects: 100% (5958/5958), done.
error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500
send-pack: unexpected disconnect while reading sideband packet
Writing objects: 100% (18207/18207), 72.05 MiB | 154.67 MiB/s, done.
Total 18207 (delta 13630), reused 16295 (delta 11969), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-dateThe errors:error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedlyHave I goofed something up with LFS? Or is it something else like the git submodules which I have not yet pushed to HF?EDIT: running this,git config --global http.postBuffer 157286400fixed the previous error by increasing memory size (or something). Looks like its an error related to the HTTP connection, which I haven’t encountered before as I always use SSH.Now I’m receiving new errors like... omitted ...
remote: Resolving deltas: 100% (13632/13632), done.
remote: -------------------------------------------------------------------------
remote: Your push was rejected because it contains files larger than 10 MiB.
remote: Please use https://git-lfs.github.com/ to store large files.
remote: See also: https://hf.co/docs/hub/repositories-getting-started#terminal
remote: 
remote: Offending files:
remote:   - docs/examples/velodyne-lidar-scan/shelby-scene.ply (ref: refs/heads/main)
remote:   - docs/examples/velodyne-lidar-scan/shelby-scene.ply (ref: refs/tags/v0.3.0-alpha.10)
remote:   - docs/examples/velodyne-lidar-scan/shelby-scene.ply (ref: refs/tags/v0.3.0-alpha.11)
... omitted ...so now I’ll try LFS.EDIT: after installing Git LFS, mygit pushes still get rejected. I’ll open a separate thread for that: