I need to disable the git credential helper for OS X: git-credential-osxkeychain
I'm using git as installed by Xcode Command Line Utilities 4.6.2 in OS X Mountain Lion 10.8.3.
In this installation the default behavior of git pull
or git push
is for the password to be remembered, thereby freeing the user from having to enter it again.
Although convenient, this is a security risk in my situation. I need to disable the credential helper so a password will be required with each remote pull
, push
or fetch
.
The git installed with Xcode does not seem to use git config
to set this feature. Here are my settings:
# 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://[email protected]/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
[ Note: there is no system config file for my installation. ]
I did a thorough search on Stack Overflow and Google, but could not find a solution to disabling credential helper in this installation.
I suspect there is a .plist or similar config file somewhere in the Xcode hierarchy that has a flag to disable, but could not find any mention of it in the git or Xcode docs.
A quick and dirty solution would be to chmod
the Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-credential-osxkeychain
binary, but that's not very elegant, and would likely break with any updates to Xcode.
Do any Xcode experts out there have any idea where Apple stashes the flag to turn this git feature off?