不建议使用基于密码的 Git 身份验证,我们建议在提示输入密码时使用个人访问令牌,因为这样更安全。 像对待密码一样对待令牌。 更多信息请参阅“创建个人访问令牌”。
通过 Keychain Access 更新凭据
- 单击菜单栏右侧的 Spotlight 图标(放大镜)。 键入
Keychain access,然后按 Enter 键启动应用程序。
- 在 Keychain Access 中,搜索 [hostname]。
- 查找
[hostname]的“互联网密码”条目。
- 相应地编辑或删除该条目。
通过命令行删除凭据
通过命令行,您可以使用凭据小助手直接擦除密钥链条目。
为此,请输入以下命令:
$ git credential-osxkeychain erase
host=hostname
protocol=https
> [Press Return]
如果成功,则不会打印出任何内容。 要测试其是否有效,请尝试并克隆 your GitHub Enterprise Server instance 仓库。 如果提示您输入密码,则该密钥链条目已删除。

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
