File size: 1,805 Bytes
e98b0a7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | @echo off
setlocal enabledelayedexpansion
set "ROOT=%~dp0.."
pushd "%ROOT%"
set "ROOT=%cd%"
title HUGGING FACE - PRIVATE SYNC
color 0B
echo.
echo #######################################################
echo # #
echo # HUGGING FACE PRIVATE SYNC (GIT LFS) #
echo # #
echo #######################################################
echo.
:: Check for Git
git --version >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] Git is not installed or not in PATH.
pause
exit /b
)
:: User Input for Repo URL
if not exist ".hf_repo_url" (
echo [FIRST TIME SETUP]
set /p repo_url="Enter your Private HF Dataset URL (e.g., https://huggingface.co/datasets/username/repo): "
echo !repo_url! > ".hf_repo_url"
)
set /p repo_url=<".hf_repo_url"
echo [1/4] Initializing Git LFS...
git init >nul 2>&1
git lfs install >nul 2>&1
:: Track large binaries automatically
echo [2/4] Tracking Large Binaries (*.exe, *.dll, *.zip, *.7z)...
git lfs track "*.exe"
git lfs track "*.dll"
git lfs track "*.zip"
git lfs track "*.7z"
git lfs track "*.msi"
git lfs track "*.iso"
git lfs track "*.bin"
git lfs track "*.dat"
git lfs track ".gitattributes"
echo [3/4] Adding files to commit...
git remote add origin !repo_url! >nul 2>&1
git add .
echo [4/4] Pushing to Hugging Face...
set /p msg="Enter update message (default: Update tools): "
if "!msg!"=="" set "msg=Update tools"
git commit -m "!msg!"
git branch -M main
git push -u origin main
echo.
echo =======================================================
echo SUCCESS: Your project is now synced with Hugging Face!
echo Everything is organized and private.
echo =======================================================
echo.
pause
|