@echo off echo ======================================== echo FIX GO-GIT INSTALLATION echo ======================================== echo. echo Step 1: Checking current Git installation... where git >nul 2>&1 if %errorlevel% equ 0 ( echo ✓ Git is already in PATH git --version ) else ( echo ❌ Git is not in PATH ) echo. echo Step 2: Checking Gitea git.exe... if exist "C:\Program Files\gitea\git.exe" ( echo ✓ Gitea git.exe exists echo Size: %~z0 ) else ( echo ❌ Gitea git.exe not found ) echo. echo Step 3: Installing Git for Windows (if needed)... echo Options: echo 1. Install Git for Windows (recommended) echo 2. Add Gitea directory to PATH echo 3. Use Gitea API instead echo. set /p choice="Choose option (1-3): " if "%choice%"=="1" ( echo. echo Downloading Git for Windows... powershell -Command "Invoke-WebRequest -Uri 'https://github.com/git-for-windows/git/releases/download/v2.45.1.windows.1/Git-2.45.1-64-bit.exe' -OutFile 'git-installer.exe'" if exist git-installer.exe ( echo Running installer... start /wait git-installer.exe del git-installer.exe echo ✓ Git for Windows installed ) else ( echo ❌ Failed to download installer ) ) else if "%choice%"=="2" ( echo. echo Adding Gitea to PATH... setx PATH "%PATH%;C:\Program Files\gitea" echo ✓ Added to PATH (requires restart) ) else if "%choice%"=="3" ( echo. echo Using Gitea API approach... echo Run: python final_gitea_commit.py "Your commit message" ) echo. echo Step 4: Testing Git... where git >nul 2>&1 if %errorlevel% equ 0 ( echo ✓ Git is now available git --version echo. echo You can now use: echo git init echo git add . echo git commit -m "Your message" echo git remote add origin https://git.mtrcompute.com/jleu3482/railseek6.git echo git push -u origin main ) else ( echo ❌ Git is still not available echo Please install Git for Windows manually: echo https://git-scm.com/download/win ) echo. echo ======================================== echo FIX COMPLETE echo ======================================== pause