Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 如何更新Git的密码?_Macos_Git_Change Password - Fatal编程技术网

Macos 如何更新Git的密码?

Macos 如何更新Git的密码?,macos,git,change-password,Macos,Git,Change Password,我将BitBucket与Xcode和Git一起用于版本控制,最近我更改了所有密码(感谢Adobe!) 毫不奇怪,我不再能够将本地提交推送到BitBucket上的存储库(Authentication failed for'https://______.git“),但我忘了如何更新iMac上的缓存密码。不知何故,我一直无法在谷歌或StackOverflow上找到它,尽管在我看来它应该相当简单…要在macOS上解决这个问题,您可以使用 git config --global credential.he

我将BitBucket与Xcode和Git一起用于版本控制,最近我更改了所有密码(感谢Adobe!)


毫不奇怪,我不再能够将本地提交推送到BitBucket上的存储库(
Authentication failed for'https://______.git“
),但我忘了如何更新iMac上的缓存密码。不知何故,我一直无法在谷歌或StackOverflow上找到它,尽管在我看来它应该相当简单…

要在macOS上解决这个问题,您可以使用

git config --global credential.helper osxkeychain
下一个Git操作(拉、克隆、推等)将出现用户名和密码提示

对于Windows,它是具有不同参数的同一命令:

git config --global credential.helper wincred

我也遇到了同样的问题,接受的答案对我没有帮助,因为密码没有存储在钥匙链中。我键入:

git pull https://myuser@bitbucket.org/mypath/myrepo.git

然后console询问我的新密码。

我会尝试在Keychain Access中删除我的帐户,然后再次运行
git clone
。Git会要求我输入新密码。

如果你是MAC用户,那么你可以从finder中打开KeyChain Access应用程序,然后查找上面列出的帐户。只需点击它并更新您的密码。
git config --global --unset user.password
git push (will prompt you for the password)
git status (will not prompt for password again)
现在试一试,事情就会迎刃而解

链接供参考:


为我工作。:)

我是第一次进入存储库。因此,没有定义
头部

最简单的方法是:

git push -u origin master

然后它将提示输入密码,一旦您输入密码,它将自动保存,您将能够推送。

其他答案在MacOS Sierra 10.12.4上对我都不起作用

以下是我必须做的:

git config --global --unset user.password
`git config --global --unset user.password`

然后运行git命令(例如git push)并重新输入用户名和密码。

尝试了所有操作,但均无效。然后,下面的方法确实奏效了

git config --global --unset user.password
git push (will prompt you for the password)
git status (will not prompt for password again)
  • 在执行上述任何步骤之前,再次锁定和解锁钥匙链,因为有时钥匙链会卡住
  • 安装GitHub桌面-它很有帮助

  • 我修改git密码的唯一方法是转到Windows中的凭据管理器(Windows键+键入“凭据”),并使用git在Windows 10中的Windows凭据下编辑git条目

    删除/更新存储在>>控制面板\所有控制面板项目\凭据管理器中的Windows凭据中的相关凭据


    在上面@Imran Javed提到的windows 10中,您可以在以下位置找到通用凭据:

    控制面板\所有控制面板项目\凭证管理器-->Windows凭证

    然后,您可以通过单击“编辑”按钮来更新密码


    在中,他们以一种非常简单的方式解释了这一点,但基本上,我们只需要执行
    git远程设置url源“https://@bitbucket.org/”
    ,下次执行
    git pull
    git push
    时,您必须输入密码。

    对于那些正在寻找如何重置对存储库的访问权限的人。以GitHub为例。您可以更改GitHub配置文件密码,并在配置文件的“设置->开发人员设置”中撤销所有“个人访问令牌”。您还可以选择擦除所有SSH/PGP密钥和OAuth/GitHub应用程序,以确保对存储库的访问被完全阻止。因此,任何系统上的所有凭证管理器在授权时都会失败,并提示您输入新凭证。

    运行
    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)
    

    以下步骤可以解决此问题

  • 转到文件夹~/Library/Application Support/SourceTree
  • 删除文件{Username}@STAuth-bitbucket.org
  • 重新启动Sourcetree
  • 尝试获取,出现密码字段,提供新密码
  • 还可以在终端中运行“git fetch”命令,需要输入密码
  • 完成

  • 在终端中执行以下步骤:

  • 删除保存在Mac中的当前密码

    git config --global --unset user.password
    
  • 使用以下命令添加新密码,替换为新密码:

    git config --global --add user.password <new_pass>
    
    git config --global --unset user.password
    
    git config --global --add user.password "new_password"
    
    git config--global--add user.password
    

  • 如果您的凭据存储在凭据帮助程序中,则删除为特定主机保留的密码的可移植方法是调用
    git credential reject

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


    之后,要输入新密码,请在我的Windows计算机中键入
    git fetch

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

    已删除当前密码:

    git config --global --add user.password <new_pass>
    
    git config --global --unset user.password
    
    git config --global --add user.password "new_password"
    
    添加新密码:

    git config --global --add user.password <new_pass>
    
    git config --global --unset user.password
    
    git config --global --add user.password "new_password"
    

    这对我很有用。

    我可以通过在Windows中转到凭据管理器,删除MAC用户Windows凭据下的所有git条目,使用git GUI更改我的git密码(适用于Sourcetree,也可能适用于其他用户)。我想对德里克的回答补充一句话()。最初的建议是:

    $ git config --global --unset user.password
    
    应该紧跟着一个推/拉/取,但是从GUI中执行时可能不起作用。%100工作情况是从控制台执行第一个连续的提示触发git命令。以下是一个例子:

  • 定位到git存储库根目录
  • 键入
    $git config--unset user.password
  • 继续在终端中选择git,例如:
    $git push

  • 然后它会要求您提供新密码。

    这个问题很混乱,因为这个问题太复杂了。第一款MacOS vs.Win10。然后是不同的身份验证机制

    我将在这里开始一个综合答案,可能需要一些帮助,如果我没有得到帮助,我将继续工作,直到答案完成,但这将需要时间

    Windows 10:|

    |-- Run this command. You will be prompted on next push/pull to enter username and password:
    |      git config --global credential.helper wincred (Thanks to @Andrew Pye)
    
    ` 马科斯:

    |
    |--使用git-config存储用户名
    
    git credential-osxkeychain erase
    host=github.com
    protocol=https
    
    `git config --global --unset user.password`