5
votes

New to Git.

Followed all the directions from github help pages but simple commands like git pull and git push continues to prompt my password on each invocation. Specifically, I set the following:

  • git config --global user.name "Your name"
  • git config --global user.email [email protected]
  • git config --global github.token 123321321sdssddaqqwq

I also setup ssh keys elaborately as per the steps mentioned in the help but password prompts don't go away.

Suggestions?

3
What is the actual prompt? It may actually be a prompt for your passphrase on your SSH key.six8

3 Answers

8
votes

From your comment saying that the password that works at this prompt is your GitHub password, I strongly suspect that you've cloned your repository using the https URL rather than the SSH URL. You can change that with:

 git remote set-url origin [email protected]:whoever/whatever.git

... where you should replace the last parameter with whatever's shown when you click the "SSH" button on your repository's page.

(You can check what URL origin currently refers to with git remote -v.)

0
votes

Did you sign your pub key with a password? If you sign your key with a password, you'll always be prompted for that key. If you want no password, re-generate your .pub file without a password and upload that to github. If anyone gets access to your machine, they can commit as you, of course.

0
votes

You have to start ssh-agent, then use ssh-add to add your key. This requires the password once per session. You can also add it to the end of /etc/bashrc to add the key automatically on startup.

Better yet, have a simple function to your key to ssh-agent:

eval `ssh-agent`;
trap "kill $SSH_AGENT_PID" 0;
add-key {
  ssh-add;
}