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

Gro*_*ger 7 git macos xcode keychain osx-mountain-lion

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

我在OS X Mountain Lion 10.8.3中使用Xcode Command Line Utilities 4.6.2安装的git .

在此安装中,git pull或者git push要记住密码的默认行为,从而使用户不必再次输入密码.

虽然方便,但在我的情况下这是一个安全风险.我需要禁用凭证帮助程序,因此每个遥控器都需要密码pull,push或者fetch.

使用Xcode安装的git似乎不用于设置此功能.这是我的设置:git config


# git --version =>

git version 1.7.12.4 (Apple Git-37)

# git config --global --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
Run Code Online (Sandbox Code Playgroud)

# git config --local --list =>

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
Run Code Online (Sandbox Code Playgroud)

# git config --system --list =>

fatal: unable to read config file '/usr/etc/gitconfig': No such file or directory
Run Code Online (Sandbox Code Playgroud)

[注意:我的安装没有系统配置文件.]


我对Stack OverflowGoogle进行了全面搜索,但在此安装中找不到禁用凭据帮助程序的解决方案.

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

一个快速和肮脏的解决办法是chmodApplications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-credential-osxkeychain二进制,但是这不是很优雅,很可能会与任何更新Xcode的突破.

那里的任何Xcode专家都知道Apple在哪里拿着旗帜来关闭这个git功能吗?

hbo*_*ert 0

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

  1. 进入 osx 钥匙串应用程序,
  2. 如果您使用 https,请查找服务器名称
  3. 单击它来更改其设置,然后在“访问控制”选项卡下标记“询问钥匙串密码”
  4. 如果需要,请从白名单应用程序列表中删除 git-credential-osxkeychain 应用程序。(就我而言,此时我必须保存,返回设置并重新启用“询问钥匙串密码”,该功能再次被禁用。)

请注意,在 Linux 上,默认行为也是自动发送凭据。