禁用git凭证-osxkeychain [英] disable git credential-osxkeychain

查看:185
本文介绍了禁用git凭证-osxkeychain的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要禁用OS X的凭证助手: git凭证-osxkeychain



它被禁用在全局配置文件和本地配置文件中,实际上它已启用 never ben。不过,它会记住我的github登录详细信息。

我在笔记本电脑上,因此我不希望自动无密码地访问我的回购站。

I will 使用ssh密钥。这是一台新电脑,整个系统设置仍在进行中。

现在我使用了 https repo refs和凭证

这些是我的conf文件:




git config --edit =>

  [core] 
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = false
[remoteorigin ]
url = https://github.com/user/repo.git
fetch = + refs / heads / *:refs / remotes / origin / *
[branchmaster]
remote = origin
merge = refs / heads / master
[branchdevelop]
remote = origin
merge = refs / heads / develop
[branchdeploy]
remote = origin
merge = refs / heads / deploy

git config --global --edit =>

  [user] 
email = ****************
name = tom
[color]
ui = true
[core]
editor = subl -w
[github]
user = tompave
[合并]
conflictstyle = diff3
[ push]
default = simple






另外,运行 git config --global credential.helper 不会返回任何结果(这是正确的)。然而,运行 git config credential.helper 会返回 osxkeychain $ b

>!



这怎么可能?我在本地配置文件中看不到它,它在哪里设置?



我试图在本地设置它以查看会发生什么,并且它 出现在 repodir /中。 GIT中/配置。然后我删除了条目......但帮手仍然在这里并且很活跃。

我可以清楚地看到它在OS X钥匙串中的输入。

我可以删除它,然后 git 会询问再次输入密码...但只要我输入密码(比如说,对于 git fetch ),钥匙串中的条目将被恢复。

解决方案

为了帮助追踪设置,我尝试使用:

  git config --local credential.helper 
git config --global credential.helper
git config --system credential.helper

第一个检查本地repo配置,第二个是〜/ .gitconfig ,第三个是基于git的安装位置。根据哪一个显示凭证助手,您可以尝试使用相同的 - unset 选项:

  git config --local --unset credential.helper 
git config --global --unset credential.helper
git config --system --unset credential.helper

如果您没有适当的权限,最后一个可能无法正常工作。所以你可能需要运行 sudo 下的最后一个才能正常工作。 FWIW,你可能已经为Mac OS X的预建git镜像安装了。如果你使用 / usr / local / git / etc / gitconfig ,你会看到它确实为您设置了凭证助手。所以上面的最后一条命令可以帮助解决这个问题。


I need to disable the credential helper for OS X: git credential-osxkeychain

It is disabled both in the global config file and in the local one, in fact it has never ben enabled. Still, it keeps memorizing my github login details.
I'm on a laptop, so I don't want automatic passwordless access to my repos.
I will use ssh keys. This is a new computer, and the whole system setup is still a work in progress.
For now I used the https repo refs, and the credential helper keeps kicking in.

These are my conf files:


git config --edit =>

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = false
[remote "origin"]
    url = https://github.com/user/repo.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "develop"]
    remote = origin
    merge = refs/heads/develop
[branch "deploy"]
    remote = origin
    merge = refs/heads/deploy


git config --global --edit =>

[user]
    email = ****************
    name = tom
[color]
    ui = true
[core]
    editor = subl -w
[github]
    user = tompave
[merge]
    conflictstyle = diff3
[push]
    default = simple


Also, running git config --global credential.helper returns nothing (and that's right).

However, running git config credential.helper returns osxkeychain!

How is it possible? I can't see it in the local config file, where is it set?

I tried to set it up locally to see what would happen, and it did appear in the repodir/.git/config. Then I deleted the entry... but the helper is still here and active.

I can clearly see its entry in OS X keychain.
I can delete it, and then git will ask for the password again... but as soon as I type it (let's say, for a git fetch), the entry in keychain is restored.

解决方案

To help track down the setting, I'd try to use:

git config --local credential.helper
git config --global credential.helper
git config --system credential.helper

The first one checks the local repo config, the second is your ~/.gitconfig, and the third is based on where git is installed. Depending on which one comes back showing the credential helper, you can try using the equivalent --unset option:

git config --local --unset credential.helper
git config --global --unset credential.helper
git config --system --unset credential.helper

The last one may not work if you don't have proper permissions. So you may need to run the last one under sudo for it to work correctly. FWIW, you may have installed for the pre-built git images for Mac OS X. If you cat /usr/local/git/etc/gitconfig, you'll see that it does set up the credential helper for you. So the last command above would help fix that problem.

这篇关于禁用git凭证-osxkeychain的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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