gpt4 book ai didi

xcode - 在 Xcode 安装的 git 中禁用 osxkeychain 凭证助手

转载 作者:太空狗 更新时间:2023-10-29 13:03:56 25 4
gpt4 key购买 nike

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

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

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

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

Xcode 安装的git 好像没有使用git config 来设置这个功能。这是我的设置:


# git --version =>

git 版本 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 在哪里 stash 标志以关闭此 git 功能?

最佳答案

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

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

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

关于xcode - 在 Xcode 安装的 git 中禁用 osxkeychain 凭证助手,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16255629/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com