# Adding Code from existing GitHub repository to a Space

**URL:** <https://discuss.huggingface.co/t/adding-code-from-existing-github-repository-to-a-space/58154>\
**Category:** Spaces\
**Created:** [October 11, 2023, 10:05am UTC](https://discuss.huggingface.co/t/adding-code-from-existing-github-repository-to-a-space/58154 "2023-10-11T10:05:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeteBleackley](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/petebleackley/32/51692_2.png) [@PeteBleackley](https://discuss.huggingface.co/u/PeteBleackley)\
**Post date:** [October 11, 2023, 10:05am UTC](https://discuss.huggingface.co/t/adding-code-from-existing-github-repository-to-a-space/58154/1 "2023-10-11T10:05:21Z")

</div>

I’ve got some code on GitHub that I’d like to add to a Space. I’ve added the space as a new remote, but I’m having trouble pushing to it.

```auto
git push -u -f huggingface
Username for 'https://huggingface.co': PlayfulTechnology
Password for 'https://PlayfulTechnology@huggingface.co': 
Enumerating objects: 781, done.
Counting objects: 100% (781/781), done.
Delta compression using up to 16 threads
Compressing objects: 100% (771/771), done.
Writing objects: 100% (781/781), 134.58 KiB | 3.84 MiB/s, done.
Total 781 (delta 510), reused 2 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (510/510), done.
remote: -------------------------------------------------------------------------
remote: You are not authorized to push to some of the references:
remote: - refs/remotes/origin/HEAD: Cannot create or delete refs that are not branches or tags with git push
remote: - refs/remotes/origin/main: Cannot create or delete refs that are not branches or tags with git push
remote: -------------------------------------------------------------------------
To https://huggingface.co/spaces/PlayfulTechnology/QARAC
 ! [remote rejected] main -> main (pre-receive hook declined)
 ! [remote rejected] origin/HEAD -> origin/HEAD (deny updating a hidden ref)
 ! [remote rejected] origin/main -> origin/main (deny updating a hidden ref)
error: failed to push some refs to 'https://huggingface.co/spaces/PlayfulTechnology/QARAC'

```

What can I do about this? (the space is PlayfulTechnology/QARAC)

---

<div class="post-metadata">

**Author:** ![PeteBleackley](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/petebleackley/32/51692_2.png) [@PeteBleackley](https://discuss.huggingface.co/u/PeteBleackley)\
**Post date:** [October 11, 2023, 4:40pm UTC](https://discuss.huggingface.co/t/adding-code-from-existing-github-repository-to-a-space/58154/2 "2023-10-11T16:40:27Z")

</div>

It was an authentication error. Solved by using SSH.
