The Simplest Method
- Go to https://git-lfs.com/ and download Git Large File Storage for your operating system.
- In your Hugging Face space, open the menu with the three dots and select
Clone repository.
- Run the following commands in the terminal:
- First, run
git lfs installto check that Git Large File Storage is installed. If installed, the response will beGit LFS initialized. - Next, run
git clone https://huggingface.co/spaces/<USERNAME>/<SPACE_NAME>and replace USERNAME and SPACE_NAME with your Hugging Face username and the name of the space you want to download. This command will download your space!
- Create a new GitHub repository.
- Complete the
Repository namefield and theDescription, but do not add a README. Your project already has one! ClickCreate repositorywhen you’re done.
- There are many ways to set up a repository. Select the
uploading an existing fileoption.
- Drag and drop the files (not the folder) into your GitHub repository.

- Tada! 🎉 Your Hugging Face project is now on GitHub! It’s probably a good idea to edit the README at this point to include a description of your project and a link to the Hugging Face space, so that readers can interact with your chatbot.
Other Methods
This method of creating a GitHub repository will not update with any new changes to your Hugging Face space. This is the simplest method, but there are others!
When the Simplest Method Makes Sense
- You want to preserve a working version before major changes
- You're migrating from HF Spaces to GitHub permanently
- You want to share your HF Space code with collaborators who prefer GitHub
- You need a backup before experimenting with your HF Space
- You want to apply for jobs and showcase the code on GitHub
However, if you need to sync future changes in Hugging Face to your GitHub repository or you want changes in GitHub to sync with your Hugging Face space, you’ll need to configure GitHub Actions! Get started with learning about GitHub Actions here.