I followed these instructions to the letter, including the part about password caching. It seems like the instructions are wrong, because every time I git push origin master
I get this error:
git: 'credential-cache' is not a git command. See 'get --help'.
... at which point I am forced to enter my username and password. After doing so, I am presented with the same error message again, followed by the output from git push
.
Here is the contents of my .gitconfig file:
[user]
name = myusername
email = [email protected]
[credential]
helper = cache
To be clear, after I installed Git and ran Git Bash, here is exactly what I typed:
git config --global user.name "myusername"
git config --global user.email "[email protected]"
git config --global credential.helper cache
Please help. This is so frustrating!
This question is related to
git
msysgit
git-bash
git-config
For the sake of others having this issue - I landed here because I tried to get cute with how I set up a new github repository, but per the setup page credential helper doesn't work unless you clone a repository.
"Tip: The credential helper only works when you clone an HTTPS repository URL. If you use the SSH repository URL instead, SSH keys are used for authentication. This guide offers help generating and using an SSH key pair."
For the sake of others who come on this issue, I had this same problem in Ubuntu (namely that my passwords weren't caching, despite having set the option correctly, and getting the error git: 'credential-cache' is not a git command.
), until I found out that this feature is only available in Git 1.7.9 and above.
Being on an older distribution of Ubuntu (Natty; I'm a stubborn Gnome 2 user) the version in the repo was git version 1.7.4.1. I used the following PPA to upgrade: https://launchpad.net/~git-core/+archive/ppa
There is now a much easier way to setup Git password caching by double clicking a small exe on Windows. The program is still based on git-credential-winstore
mentioned by the top voted answer, although the project has been moved from GitHub to http://gitcredentialstore.codeplex.com/
You can download the exe (and a binary for Mac) from this blog post: https://github.com/blog/1104-credential-caching-for-wrist-friendly-git-usage
A similar error is 'credential-wincred' is not a git command
wincred
is for the project git-credential-winstore which is no longer maintained.It was replaced by Git-Credential-Manager-for-Windows maintained by Microsoft open source.
Download the release as zip file from link above and extract contents to
\cygwin\usr\libexec\git-core
(or \cygwin64\usr\libexec\git-core
as it may be)
Then enable it, (by setting the global .gitconfig
) - execute:
git config --global credential.helper manager
How to use
No further config is needed.
It works [automatically] when credentials are needed.
For example, when pushing to Azure DevOps, it opens a window and initializes an oauth2 flow to get your token.
ref:
I fixed this issue by removing the credential
section from the config of specific project:
git config -e
[credential] helper = cache
.This removed the annoying message :
git: 'credential-cache' is not a git command. See 'git --help'.
First find the version you are using for GIT.
using this command : git --version
if you have a newer version than 1.7.10.
Then simply use this this command.
Windows:
git config --global credential.helper wincred
MAC
git config --global credential.helper osxkeychain
I faced this problem while using AptanaStudio3 on windows7. This helped me:
git config --global credential.helper wincred
Code taken from here
First run git config --global credential.helper wincred
Then go to: CONTROL PANEL\CREDENTIAL MANAGER\WINDOWS CREDENTIAL\GENERIC CREDENTIAL
then click in add a credential in Internet or network address:
add git:https://
{username}.github.com
User:
{name}
Password:
{Password}
We had the same issue with our Azure DevOps repositories after our domain changed, i.e. from @xy.com to @xyz.com. To fix this issue, we generated a fresh personal access token with the following permissions:
Code: read & write Packaging: read
Then we opened the Windows Credential Manager, added a new generic windows credential with the following details:
Internet or network address: "git:{projectname}@dev.azure.com/{projectname}" - alternatively you should use your git repository name here.
User name: "Personal Access Token"
Password: {The generated Personal Access Token}
Afterwards all our git operations were working again. Hope this helps someone else!
Looks like git
now comes with wincred
out-of-the-box on Windows (msysgit):
git config --global credential.helper wincred
Reference: https://github.com/msysgit/git/commit/e2770979fec968a25ac21e34f9082bc17a71a780
I realize I'm a little late to the conversation, but I encountered the exact same issue In my git config I had two entries credentials…
In my .gitconfig file
[credential]
helper = cached
[credentials]
helper = wincred
The Fix: Changed my .gitconfig file to the settings below
[credential]
helper = wincred
[credentials]
helper = wincred
Source: Stackoverflow.com