If someone accidently commits to the HF space instead of to the Github, we can fix it by manually aligning the Github with the space.
- Clone this Github:
git clone https://github.com/embeddings-benchmark/arena.git
- Add the space a git remote:
git remote add space https://huggingface.co/spaces/mteb/arena
- Fetch everything on Git LFS:
git lfs fetch --all
- Fetch everything normally:
git fetch space
- Merge into the Github:
git merge space/main
. If this works, you can commit/push and be done! - Verify that the Github codebase online looks like the Space code!
Sometimes if a new LFS file was uploaded the space, git complains because it can't find it. If this happens:
- Locate the files that it is complaining it doesn't have by clicking on the log error it gave you.
- You'll need to add that file name to the Github's gitattributes locally (or match it with the HF spaces gitattributes file)
- Upload the file to the repo manually (e.g. copy it into the right spot)
- Add it to the git history with git add/commit/push it with `git push origin main.
- Once all the Git LFS stuff is taken care of, you can do
git push --force origin space/main:main
to force push the space repo into the Github repo. Note: this will overwrite history, so be careful! - Now they should align! You can check by adding a new file to the Github and making sure it propogates to the space.