Spaces:
Paused
Paused
| @echo off | |
| echo π§Ή Deep cleaning repository history... | |
| echo. | |
| echo β οΈ WARNING: This will rewrite git history! | |
| echo This will remove all binary files from the entire git history. | |
| echo. | |
| set /p confirm="Are you sure you want to continue? (y/N): " | |
| if /i not "%confirm%"=="y" ( | |
| echo Cancelled. | |
| pause | |
| exit /b 0 | |
| ) | |
| echo. | |
| echo ποΈ Removing binary files from git history... | |
| REM Remove vector store directory from entire history | |
| git filter-branch --force --index-filter "git rm -rf --cached --ignore-unmatch vector_store/" --prune-empty --tag-name-filter cat -- --all | |
| REM Remove database files from entire history | |
| git filter-branch --force --index-filter "git rm -rf --cached --ignore-unmatch *.db" --prune-empty --tag-name-filter cat -- --all | |
| git filter-branch --force --index-filter "git rm -rf --cached --ignore-unmatch *.sqlite" --prune-empty --tag-name-filter cat -- --all | |
| git filter-branch --force --index-filter "git rm -rf --cached --ignore-unmatch *.sqlite3" --prune-empty --tag-name-filter cat -- --all | |
| REM Remove FAISS files from entire history | |
| git filter-branch --force --index-filter "git rm -rf --cached --ignore-unmatch *.faiss" --prune-empty --tag-name-filter cat -- --all | |
| git filter-branch --force --index-filter "git rm -rf --cached --ignore-unmatch *.index" --prune-empty --tag-name-filter cat -- --all | |
| REM Remove log files from entire history | |
| git filter-branch --force --index-filter "git rm -rf --cached --ignore-unmatch *.log" --prune-empty --tag-name-filter cat -- --all | |
| echo. | |
| echo π§Ή Cleaning up... | |
| git for-each-ref --format="delete %(refname)" refs/original | git update-ref --stdin | |
| git reflog expire --expire=now --all | |
| git gc --prune=now --aggressive | |
| echo. | |
| echo β Repository history cleaned! | |
| echo. | |
| echo π Now commit the current state... | |
| git add . | |
| git commit -m "Clean repository for Hugging Face deployment" | |
| echo. | |
| echo π Ready to push! Run: | |
| echo git push --force space develop | |
| echo. | |
| echo Or create a new branch: | |
| echo git checkout -b main | |
| echo git push space main | |
| echo. | |
| pause |