8

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

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

在此安装中,默认行为git pullorgit 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

# 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

# git config --system --list =>

fatal: unable to read config file '/usr/etc/gitconfig': No such file or directory

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


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

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

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

是否有任何Xcode专家知道 Apple 在哪里隐藏标志以关闭此git功能?

4

1 回答 1

0

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

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

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

于 2014-10-21T08:36:57.173 回答