禁用由Xcode安装的git中的osxkeychain凭证帮助程序

禁用由Xcode安装的git中的osxkeychain凭证帮助程序,xcode,macos,git,osx-mountain-lion,keychain,Xcode,Macos,Git,Osx Mountain Lion,Keychain,我需要禁用OS X的git credential helper:git credential osxkeychain 我使用的是OS X Mountain Lion 10.8.3中Xcode命令行实用程序4.6.2安装的git 在此安装中,git pull或git push的默认行为是记住密码,从而使用户无需再次输入密码 虽然方便,但在我的情况下,这是一种安全风险。我需要禁用凭证帮助器,以便在每次远程拉取、推取或提取时都需要密码 与Xcode一起安装的git似乎没有使用git config来设置

我需要禁用OS X的git credential helper:
git credential osxkeychain

我使用的是OS X Mountain Lion 10.8.3中Xcode命令行实用程序4.6.2安装的git

在此安装中,
git pull
git push
的默认行为是记住密码,从而使用户无需再次输入密码

虽然方便,但在我的情况下,这是一种安全风险。我需要禁用凭证帮助器,以便在每次远程
拉取
推取
提取时都需要密码

与Xcode一起安装的git似乎没有使用
git config
来设置此功能。以下是我的设置:


#git--version
=>

fatal: unable to read config file '/usr/etc/gitconfig': No such file or directory
git版本1.7.12.4(Apple git-37)

#git config--全局--列表
=>

user.name=User Name
user.email=user@home
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=auto
color.ui=auto
alias.lol=log --pretty=oneline --abbrev-commit --graph --decorate
alias.co=checkout
alias.ci=commit
alias.st=status
alias.br=branch
alias.hist=log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
alias.type=cat-file -t
alias.dump=cat-file -p
core.autocrlf=input
core.safecrlf=true
core.editor=/usr/bin/vim
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=https://XXXXXXX@bitbucket.org/YYYYYYYY/ZZZ.git
branch.master.remote=origin
branch.master.merge=refs/heads/master
#git config--local--list
=>

user.name=User Name
user.email=user@home
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=auto
color.ui=auto
alias.lol=log --pretty=oneline --abbrev-commit --graph --decorate
alias.co=checkout
alias.ci=commit
alias.st=status
alias.br=branch
alias.hist=log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
alias.type=cat-file -t
alias.dump=cat-file -p
core.autocrlf=input
core.safecrlf=true
core.editor=/usr/bin/vim
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=https://XXXXXXX@bitbucket.org/YYYYYYYY/ZZZ.git
branch.master.remote=origin
branch.master.merge=refs/heads/master
#git config--系统--列表
=>

fatal: unable to read config file '/usr/etc/gitconfig': No such file or directory
[注意:我的安装没有系统配置文件。]


我在Stack Overflow和Google上做了彻底的搜索,但找不到在此安装中禁用credential helper的解决方案

我怀疑Xcode层次结构中的某个地方有一个.plist或类似的配置文件,它有一个要禁用的标志,但在git或Xcode文档中找不到任何关于它的提及

一个快速而肮脏的解决方案是
chmod
Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-credential-osxkeychain
二进制文件,但这并不十分优雅,而且可能会随着Xcode的任何更新而中断


有没有任何Xcode专家知道苹果公司将关闭git功能的标志放在哪里?

如果你的问题主要关注的是安全性,并且你希望每次都输入密码,那么我会使用钥匙链来满足你的目标

  • 进入osx钥匙链应用程序
  • 如果使用https,请查找服务器名
  • 通过单击更改其设置,并在“访问控制”选项卡下标记“询问钥匙链密码”
  • 如果需要,从白名单应用程序列表中删除git credential osxkeychain应用程序。(在我的例子中,我必须在此时保存,返回到设置并重新启用“询问钥匙链密码”,该密码不知何故再次被禁用。)
  • 请注意,在Linux上,默认行为也是自动发送凭据。

    可能重复的凭据