metadata
title: Pushing Github To Hf
emoji: π
colorFrom: red
colorTo: indigo
sdk: gradio
sdk_version: 5.28.0
app_file: app.py
pinned: false
short_description: pushing-github-to-hf
Linking and Pushing Github Repo to Huggingface Space
Create HuggingFace Space.
- Do NOT clone the HuggingFace Space's repo locally.
- Just copy contents of its README.md file
Create a GitHub repo
- DO clone the GitHub repo locally
Edit your Github README.md file with the contents of your HF Space README.md file
Develop your app locally.
Must have:
- requirements.txt
- app.py
- README.md <-- MUST START WITH with HuggingFace formatting (the stuff between the two --- at the top))
Add, commit, and push to github
- Dont push any api keys...
- If using any api keys, add them to your HF_SPACE secrets via the huggingface space web site.
Linking Github to HF
Get URL of your huggingface space
https://huggingface.co/spaces/HF_USERNAME/SPACE_NAME
https://huggingface.co/spaces/KingZack/pushing-github-to-hf
Set Github remote to your HuggingFace space
git remote add space https://huggingface.co/spaces/KingZack/pushing-github-to-hf
Push what is in your Github to HuggingFace
git push --force space main
FIN :)
- Dont forget, everytime you push to github you also have to push to huggingface by doing:
git push --force space main