This commit is contained in:
tfarcraw 2026-08-12 10:35:10 +08:00
parent b59a4605c4
commit cae0c0aabe

23
gitout.bat Normal file
View File

@ -0,0 +1,23 @@
@echo off
echo 正在清除已保存的 Git 凭据...
echo.
rem 删除所有以 git: 开头的凭据(适用于 HTTPS)
for /f "tokens=*" %%i in ('cmdkey /list ^| findstr /i "git:"') do (
set "line=%%i"
echo 删除凭据: !line!
cmdkey /delete "!line!" >nul 2>&1
)
rem 使用 git 的 credential manager 清除(若安装了 Git Credential Manager Core)
echo.
echo 清除 Git Credential Manager 缓存...
git credential-manager-core erase < nul
echo.
echo ✅ Git 凭据已清除完成。
echo 请重新在 VS2022 中克隆或推送代码,系统将重新提示登录。
echo.
pause