VS Code 有一个内置扩展GitHub Authentication
,用于管理 GitHub 个人访问令牌的创建和自动登录。
但是,如果您使用多个 GitHub 帐户,扩展程序可能会尝试为错误的帐户生成 PAT,从而导致访问被拒绝。
Logon failed, use ctrl+c to cancel basic credential prompt.
remote: Permission to MyAccount/repo.git denied to OtherAccount.
fatal: unable to access 'https://github.com/MyAccount/repo.git/': Failure when receiving data from the peer