我使用BitBucket与Xcode和Git进行版本控制,最近我更改了我所有的密码(感谢Adobe!)

不出意外,我不能再把我的本地提交推到我在BitBucket上的存储库(“https://______.git”认证失败),但我忘记了如何更新iMac上缓存的密码。不知何故,我一直无法在谷歌或Stack Overflow上找到它,尽管在我看来它应该是相当直接的…


当前回答

在我的Windows机器上,我尝试了@nzrytmn的解决方案,即, 控制面板>搜索凭据>选择“ManageCredentials”>在对应我的用户名的git选项类别下修改了新的凭据。 然后,

删除当前密码:

git config --global --unset user.password

新增新密码:

git config --global --add user.password "new_password"

这招对我很管用。

其他回答

这是我第一次推进仓库。所以没有定义HEAD。

最简单的方法是:

git push -u origin master

然后它会提示输入密码,一旦你输入密码,它就会自动保存,你就可以按了。

如果你是MAC用户,那么你可以从finder打开KeyChain访问应用程序,然后寻找你列出的帐户。只需点击它并更新你的密码。 现在试一试,一切都会迎刃而解。

链接参考:更新您的凭证通过钥匙链访问

运行git config——global——unset user。Password后跟任何git命令都会提示您输入用户名和密码。

git config --global --unset user.password
git push (will prompt you for the password)
git status (will not prompt for password again)

在Terminal执行以下步骤:

删除保存在Mac中的当前密码 Git配置——global——取消设置user.password 使用此命令添加您的新密码,替换为您的新密码: Git配置——global——添加用户。密码< new_pass >

如果你的凭据存储在凭据助手中,移除特定主机的密码持久化的可移植方法是调用git credential reject:

$ git credential reject
protocol=https
host=bitbucket.org
⏎

or

$ git credential reject
url=https://bitbucket.org
⏎

然后,输入git fetch来输入新密码。