如果你是想换绑另一个 GitHub 账号,在 PowerShell 执行:
# 登录新账号,按提示选择浏览器登录
gh auth login --hostname github.com --web
# 让 Git 使用该账号凭据
gh auth setup-git
# 查看当前登录账号
gh auth status如果新账号之前已经登录过,直接切换:
gh auth switch --hostname github.com如果你指的是更换项目绑定的仓库,用这个:
git remote set-url origin https://github.com/新账号/仓库名.git
git remote -v星期四21:11
0 评论