简体   繁体   English

如何停止永久性和全局性地存储git凭证的钥匙串?

[英]How do I stop keychain storing git credentials, permanently and globally?

Every time I authenticate to github on a shared computer I need to delete my creds from keychain. 每次我在共享计算机上通过github进行身份验证时,都需要从钥匙串中删除我的信用。

Is there a way to permanently turning this off for all repos? 有没有办法永久关闭所有回购协议?

Make sure the credential helper is declared "globally", meaning at your account level. 确保凭据助手被声明为“全局”,即在您的帐户级别。

But if, by shared, you mean "using the same account", then yes, you can 但是,如果共享表示“使用同一帐户”,那么可以

  • deactivate the credential helper (generally not set at the system level, only global, so git config --global --unset-all credential.helper 停用凭据帮助器(通常不在系统级别设置,仅全局设置,因此git config --global --unset-all credential.helper
  • use SSH, with a key per actual user (and setting GIT_SSH_COMMAND to ~/.ssh/my_actual_private_key ) 使用SSH,每个实际用户都有一个密钥(并将GIT_SSH_COMMAND to ~/.ssh/my_actual_private_key设置GIT_SSH_COMMAND to ~/.ssh/my_actual_private_key

That way, even if you are using only one account on the shared computer, you can still reference a credential which references you, and only you. 这样,即使您在共享计算机上仅使用一个帐户,您仍然可以引用仅引用您的凭据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM