Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git can't remember password [closed]

I'm new to using git. Each time I want to push my file to github, it always shows me notification to enter my passphrase. Ex: password for 'https://[email protected]'

I want my git remember the passphrase for me. How should I possibly do that on windows 7? I've already read the help page here https://help.github.com/articles/set-up-git

like image 208
Ahmed el-Gendy Avatar asked Dec 23 '12 11:12

Ahmed el-Gendy


People also ask

How do I get Git to remember my password?

To save username and password in Git, open your “GitHub” remote repository and copy its “URL”. Then, launch “Git Bash”, paste the “URL” with the “$ git clone” command, specify the credential and execute it. Lastly, run the “$ git config –global credential. helper store” command to save the credential in the “.

Where is Git password saved?

The default path for the git credential store is $HOME/. git-credentials (or $XDG_CONFIG_HOME/git/credentials, if the previous location doesn't exist).

How does Git store passwords?

You can use git-credential-store to store your passwords unencrypted on the disk, protected only by the permissions of the file system. You can check the credentials stored in the file ~/.git-credentials . For more information, visit git-credential-store - Helper to store credentials on disk. Save this answer.

Where does Git store password on Windows?

The default is ~/. git-credentials .


1 Answers

If you're following the instructions on Github, note this line.

Good to know: The credential helper only works when you clone an HTTPS repo URL. If you use the SSH repo URL instead, SSH keys are used for authentication.

You're using ssh, so the git credential helper isn't going to work. You have a few options.

  • Set up an ssh-agent to store your ssh key passwords.

The ssh issue isn't specific to git. You can set up an ssh-agent so you only have to enter an ssh key password once. It will be remembered, safely stored in memory, until you log out. Github has a tutorial about setting up an ssh-agent.

No matter which option you pick, I would highly recommend you take the time to set up an ssh-agent. Ssh is so useful and so widespread you're going to run into this problem again.

  • Switch to using https instead of ssh.

Instead of cloning from [email protected]:username/my-repo.git you can clone from https://github.com/username/my-repo.git. It's the http button on your project page. Then the git credential helper described in the github docs will work. You'll probably have to install it first, or use their Github app. This is all described in the Password Caching section of the Github on Windows setup guide.

  • Use their Github app.

The guide mentions they have a Github app now and it can probably take care of this for you. However this is only a stop gap as other git servers won't have such a thing.

like image 158
Schwern Avatar answered Sep 24 '22 22:09

Schwern