# Cannot push with SSH

**URL:** <https://discuss.huggingface.co/t/cannot-push-with-ssh/67004>\
**Category:** Spaces\
**Created:** [December 25, 2023, 9:54pm UTC](https://discuss.huggingface.co/t/cannot-push-with-ssh/67004 "2023-12-25T21:54:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tannhorn](https://avatars.discourse-cdn.com/v4/letter/t/85f322/32.png) [@Tannhorn](https://discuss.huggingface.co/u/Tannhorn)\
**Post date:** [December 25, 2023, 9:54pm UTC](https://discuss.huggingface.co/t/cannot-push-with-ssh/67004/1 "2023-12-25T21:54:42Z")

</div>

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](https://huggingface.co/spaces/Tannhorn/fastai_pet_classifier2) 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!

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [January 3, 2024, 4:33pm UTC](https://discuss.huggingface.co/t/cannot-push-with-ssh/67004/2 "2024-01-03T16:33:55Z")

</div>

hi @Tannhorn,

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

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

```

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

---

<div class="post-metadata">

**Author:** ![Tannhorn](https://avatars.discourse-cdn.com/v4/letter/t/85f322/32.png) [@Tannhorn](https://discuss.huggingface.co/u/Tannhorn)\
**Post date:** [January 3, 2024, 7:31pm UTC](https://discuss.huggingface.co/t/cannot-push-with-ssh/67004/3 "2024-01-03T19:31:42Z")

</div>

Hello @radames, thank you for your reply!

This is the content of my .git/config:

```auto
[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

```

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [January 3, 2024, 7:34pm UTC](https://discuss.huggingface.co/t/cannot-push-with-ssh/67004/4 "2024-01-03T19:34:38Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![Tannhorn](https://avatars.discourse-cdn.com/v4/letter/t/85f322/32.png) [@Tannhorn](https://discuss.huggingface.co/u/Tannhorn)\
**Post date:** [January 3, 2024, 7:49pm UTC](https://discuss.huggingface.co/t/cannot-push-with-ssh/67004/5 "2024-01-03T19:49:55Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [January 4, 2024, 11:27pm UTC](https://discuss.huggingface.co/t/cannot-push-with-ssh/67004/6 "2024-01-04T23:27:09Z")

</div>


