# Issues with syncing hf space and github repo

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fissues-with-syncing-hf-space-and-github-repo%2F92201%3E%5C
**Category:** Beginners\
**Created:** [June 14, 2024, 1:27pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fissues-with-syncing-hf-space-and-github-repo%2F92201 "2024-06-14T13:27:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Utkarsh736](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/utkarsh736/32/28201_2.png) [@Utkarsh736](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FUtkarsh736)%5C
**Post date:** [June 14, 2024, 1:27pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fissues-with-syncing-hf-space-and-github-repo%2F92201%2F1 "2024-06-14T13:27:41Z")

</div>

Hey everyone,

I want to know what the general practice is for maintaining an HF Space and GitHub repo.

I read the documentation for [Managing Spaces with Github Actions](https://huggingface.co/docs/hub/en/spaces-github-actions), but this seems more like a guide for syncing existing Github repo.

1. I had an HF Space that I cloned locally and worked with, but later thought of having a github repo for the same; after I managed to set the action workflow but both the `main.yaml` and `check.yaml` failed to run.

2. I then created a new HF Space (for diff. project) but this time I simultaneously created a GH repo and I’ll list a few issues I had with this approach

- I wasn’t able to add a remote origin for space before I cloned the space repo locally as well. Which I think shouldn’t be the case if I want to maintain only a single repo.
- After this, I don’t understand what the `git push --force space main` is for, as both repos are currently empty and have nothing to push.  
(I’m not good with git, so do let me know if this has some purpose)
- After doing this step I got an error for which I had to `--unset-upstream` in my github repo due to which a few files that got pushed to the HF Space repo don’t seem to be there in the GH repo (`README.md, app.py, .gitignore`)
- And similar to the first case the `main.yaml` and `check.yaml` actions failed here as well.

So, do I need to do things differently?  
Like should I start a GH repo first, initialize with required files, and then start an HF space or am I doing something else wrong?

(I’ll try to reproduce the errors if required)
