👋 We've unified all of GitHub's product documentation in one place! Check out the content for REST API, GraphQL API, and Developers. Learn more on the GitHub blog.


我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们
文章版本: GitHub.com

更新 OSX 密钥链中的凭据

You'll need to update your saved credentials in the git-credential-osxkeychain helper if you change your username, password, or personal access token on GitHub.

本文内容

Were you able to find what you were looking for?

For enhanced security, we recommend using a personal access token (PAT) instead of a password. Treat your PAT just like a password and enter your PAT when prompted for a password. For more information, see "Creating a personal access token."

通过 Keychain Access 更新凭据

  1. 在 Finder 中,搜索 Keychain Access 应用程序。
    Spotlight 搜索栏
  2. 在 Keychain Access 中,搜索 github.com
  3. 查找 github.com 的“互联网密码”条目。
    密钥链中的 GitHub 密码条目
  4. 相应地编辑或删除该条目。

通过命令行删除凭据

通过命令行,您可以使用凭据小助手直接擦除密钥链条目。

为此,请输入以下命令:

$ git credential-osxkeychain erase
host=github.com
protocol=https
> [Press Return]

如果成功,则不会打印出任何内容。 要测试其是否有效,请尝试并克隆 GitHub 仓库。 如果提示您输入密码,则该密钥链条目已删除。

延伸阅读

Were you able to find what you were looking for?

问问别人

找不到要找的内容?

联系我们