从Git中删除凭据 [英] Remove credentials from Git

查看:408
本文介绍了从Git中删除凭据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用几个仓库,但最近我只是在内部工作,而且都很棒。



今天,我不得不提交并推送代码其他的,但我有一些麻烦。

  $ git push appharbor master 
错误:请求的URL返回访问https://gavekortet@appharbor.com/mitivo.git/info/refs?service = git-receive-pack
致命错误:403致命:HTTP请求失败



我没有办法,那会再次输入密码。



我重置我的系统上的凭据,所以Git会问我的存储库的密码?



我已经尝试过:




  • git config --global --unset core.askpass



  • 以取消设置密码


    • git config credential.helper'cache - timeout = 1'



    为了避免凭证缓存......



    没有什么可以工作的;没有人有更好的主意吗?

    解决方案

    Git凭证缓存运行一个守护进程,将您的凭证缓存在内存中,一经请求。因此,如果您继续将此用作cache.helper选项,那么杀死您的git-credential-cache-daemon进程会抛出所有这些并导致重新提示您输入密码。



    您还可以使用 git config --global --unset credential.helper 禁用Git凭证缓存。然后重置该选项,并且您将继续为其他存储库提供缓存的凭据(如果有)。如果已经在系统配置文件(例如,Windows 2的Git)中设置了此项,您可能还需要执行 git config --system --unset credential.helper
    $ b 在Windows上,使用 manager 助手( git config --global credential.helper manager )。这将您的凭证存储在Windows凭证存储中,该存储具有控制面板界面,您可以在其中删除或编辑存储的凭证。有了这个商店,您的详细信息就可以通过您的Windows登录来保护,并且可以保留多个会话。包含在Git for Windows 2.x中的 manager 助手已经替换了Git for Windows 1.8.1.1中添加的早期的 wincred 助手。名为 winstore 的类似帮助程序也可以在线获得,并且与GitExtensions一起使用,因为它提供了更多的GUI驱动的界面。 manager 助手提供了与 winstore 相同的GUI界面。



    详细介绍Windows凭证存储面板的Windows手册


    通过单击开始按钮开始按钮的图片,单击控制面板,单击用户帐户和家庭安全(或单击用户帐户,if您连接到网络域),然后单击用户帐户。在左侧窗格中,点击管理您的凭证。



    I'm working with several repositories, but lately I was just working in our internal one and all was great.

    Today I had to commit and push code into other one, but I'm having some troubles.

    $ git push appharbor master
    error: The requested URL returned error: 403 while accessing https://gavekortet@appharbor.com/mitivo.git/info/refs?service=git-receive-pack
    fatal: HTTP request failed
    

    There is nothing I can do, that would bring the password entry again.

    How can I reset the credentials on my system so Git will ask me for the password of that repository?

    I have tried:

    • git config --global --unset core.askpass

    in order to unset the password

    • git config credential.helper 'cache --timeout=1'

    in order to avoid credentials cache...

    Nothing seems to work; does anyone have a better idea?

    解决方案

    The Git credential cache runs a daemon process which caches your credentials in memory and hands them out on demand. So killing your git-credential-cache--daemon process throws all these away and results in re-prompting you for your password if you continue to use this as the cache.helper option.

    You could also disable use of the Git credential cache using git config --global --unset credential.helper. Then reset this, and you would continue to have the cached credentials available for other repositories (if any). You may also need to do git config --system --unset credential.helper if this has been set in the system configuration file (for example, Git for Windows 2).

    On Windows you might be better off using the manager helper (git config --global credential.helper manager). This stores your credentials in the Windows credential store which has a Control Panel interface where you can delete or edit your stored credentials. With this store, your details are secured by your Windows login and can persist over multiple sessions. The manager helper included in Git for Windows 2.x has replaced the earlier wincred helper that was added in Git for Windows 1.8.1.1. A similar helper called winstore is also available online and was used with GitExtensions as it offers a more GUI driven interface. The manager helper offers the same GUI interface as winstore.

    Extract from the Windows manual detailing the Windows credential store panel:

    Open User Accounts by clicking the Start button Picture of the Start button, clicking Control Panel, clicking User Accounts and Family Safety (or clicking User Accounts, if you are connected to a network domain), and then clicking User Accounts. In the left pane, click Manage your credentials.

    这篇关于从Git中删除凭据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆