How do I disable git's credential helper for a single repository?

后端 未结 5 1411
小蘑菇
小蘑菇 2020-11-27 18:02

If I have a credential helper set in my ~/.gitconfig, how can I disable/bypass it in a specific repo and use no credential helper?

I\'ve tried

5条回答
  •  不知归路
    2020-11-27 18:54

    I just ran into this problem as well, as the first credential.helper I had configured was always executing when I wanted to test a new one. This is on macOS using git supplied with Apple's dev tools.

    Listing the configs with git config --list showed both helpers.

    Running git config --global --edit did not show the setting for the first helper. It's a little strange that --global when configuring the helper is not the same scope as --global while editing the configs.

    Also since it I wanted to include a different helper, just blanking it out wasn't going to solve it.

    Finally found the setting in two places:

    • /Library/Developer/CommandLineTools/usr/share/git-core/gitconfig
    • /Applications/Xcode.app/Contents/Developer/usr/share/git-core/gitconfig

    Removed the credential section from the first one, but both settings were still listed using --list. After rebooting and trying every combo of unset, unset-all --system, --global, et, I found the second file.

    Removed the setting from that file (again was only one) and finally --list does not show any helpers configured.

提交回复
热议问题