I am using Cygwin and Git. Every time I push/pull to a repo on Bitbucket with a https url I am asked to enter a password. Is there a way to store these credentials (like with ssh-keys)?
I tried to install Windows Credential Store for Git but I can't get it to work with cygwin's Git.
Thanks!
Update:
I found my answer here: Is there a way to skip password typing when using https:// on GitHub?
Summarized:
Remember passwords for 15 minutes (default):
git config --global credential.helper cache
Remember passwords for 10 hours:
git config --global credential.helper 'cache --timeout=36000'
Store passwords (didn't try this):
git config --global credential.helper store
Reset:
git config --unset --global credential.helper
Cim
To cache your GitHub password in Git when using HTTPS, you can use a credential helper to tell Git to remember your GitHub username and password every time it talks to GitHub.
You can add the --global argument to save them globally. Once prompted, run a git pull command and enter your username and password. Git will save your credentials, and you can access your remote repo automatically from this point. This method has a small catch.
The way OP answered his own question is one way to go about it.
The Windows Credential Store project was discontinued in 2015. Its original author suggests to use Git Credential Manager for Windows, maintained by Microsoft. Their installer is focused on Git for Windows, however the program itself works well with Cygwin, you just have to install it manually.
Go the GCMW's latest release, download the zip file (not the installer), extract its contents (only .dll
and .exe
files are needed) to C:\cygwin\usr\libexec\git-core\
for 32-bit Cygwin, or C:\cygwin64\usr\libexec\git-core\
for 64-bit Cygwin. Reference
To get git to use GCMW, execute: git config --global credential.helper manager
To get GUI prompts for credentials, execute: git config --global credential.modalprompt true
If you want this to be a per-repository setting, remove the --global
option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With