@echo off chcp 65001 >nul setlocal echo ======================================== echo Git 清空远程分支并重新上传 echo ======================================== set "BRANCH=main" echo. echo [1/6] 删除本地 Git 信息... if exist ".git" ( rmdir /s /q ".git" ) echo. echo [2/6] 初始化 Git... git init echo. echo [3/6] 添加所有文件... git add -A echo. echo [4/6] 创建提交... git commit -m "Initial commit" echo. echo [5/6] 设置远程仓库... REM ===== 修改成你的 Git 仓库地址 ===== set "REMOTE=https://dev.azure.com/Add270433/_git/hptest" git remote add origin "%REMOTE%" echo. echo [6/6] 上传到远程仓库... git branch -M %BRANCH% git push -u origin %BRANCH% --force echo. echo ======================================== echo 上传完成! echo ======================================== pause