23

After attempting to setup git credential cache on Windows 7 I would now like to scrap the idea and remove this error message and setting from git.

git: 'credential-cache' is not a git command.

This related question shows how to fix this error by installing additional software to make the credential caching work -- I however wish to remove this setting all together.

How do I do this?

I have tried: git config --global --remove-section credential-cache and variations thereof. Also it does not exist in my .git/config file either.

Community
  • 1
  • 1
Bradley Flood
  • 10,233
  • 3
  • 46
  • 43

8 Answers8

39

Running git config --global -e allowed me to remove the offending config setting from the global git config.

[credential]
helper = winstore
Bradley Flood
  • 10,233
  • 3
  • 46
  • 43
  • 2
    Make sure to check your local (and possibly system) configs as well - git config -e loads up the config for the current repository. You can have credential helpers defined in multiple places, this helped me ferret out a second helper I had defined in a specific repository. – Guy Starbuck Apr 14 '16 at 21:33
  • 4
    With older versions winstore or cache might not work. I used `[credential] helper = wincred` based on [http://stackoverflow.com/a/11889392/922741] and happy days – tie May 04 '16 at 06:42
  • 1
    @claudekennilol Presumably they removed those lines (in VIM you can press 'dd' on a line to delete it) and saved the file by typing :wq! – Joseph Bleau Jan 03 '19 at 15:31
  • thanks! this works well. I did go with wincred vs winstore – Theo Mar 03 '22 at 06:55
15

I ran git config --global -e but it did not contain any sections related to credentials.

However, when I ran git config -e I did find there was a [credential] section.

The following command resolved the issue for me.

git config --remove-section credential

James Adkison
  • 9,412
  • 2
  • 29
  • 43
14

I had same problem with error:

$ git push -u origin master
git: 'credential-cache' is not a git command. See 'git --help'.
Branch master set up to track remote branch master from origin.
Everything up-to-date

So I decided to get rid of credential caching altogether, and I did it with in Git bash:

git config --global -e

then I found

[credential]
    helper = cache

and deleted it, saved file and after I tried again result was:

$ git push
Everything up-to-date

So error gone away.

Nenad Bulatović
  • 7,238
  • 14
  • 83
  • 113
7

Just reaffirming what Bradley Flood correctly said, running git config --global -e worked for me too and to extend on this the config setting I deleted was:

    [credential]
    helper = winstore
ladygargar
  • 597
  • 10
  • 14
4

I fixed this issue in ubuntu ,just type below command in terminal.

sudo git config --system --unset credential.helper manager

this worked for me.

Vinyas Bj
  • 123
  • 6
2
git config --system -e

press 'I' for edit;

remove code

[credential]
helper=xxxxxx

press 'Esc' for close editor and write ':wq' to exit from editor;

2

I had the same problem -

$ git push
git: 'credential-user.name' is not a git command. See 'git --help'.
git: 'credential-user.email' is not a git command. See 'git --help'.
git: 'credential---replace-all' is not a git command. See 'git --help'.

So I decided to get rid of all credential caching:

git config --global -e

Here you can remove all the helper lines -

[credential]
        helper = xxxx

Save it and try again:

$ git push
Everything up-to-date

If you want to store your git password in your local PC so that you don't need to enter it everytime then try:

git config --global credential.helper store

This will add:

[credential]
        helper = store

And then retry git push and give username and password once. After this, you won't have to give username and password anymore for your git pull or git push commands.

0

I was getting the same error, the reason was instead for pulling the branch from remote 'feat_x', I created the branch 'feat_x' in my local repo. Here fix was to delete the branch from local repo and pull it again from the remote.

u_pendra
  • 908
  • 1
  • 10
  • 25