Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup Git Bash (msysgit) with a github token or ssh key

Tags:

git

github

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?

like image 374
pri Avatar asked Sep 08 '11 18:09

pri


People also ask

How do I add a GitHub authentication token?

In the upper-right corner of any page, click your profile photo, then click Settings. In the left sidebar, click Developer settings. In the left sidebar, click Personal access tokens. Click Generate new token.


1 Answers

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.)

like image 166
Mark Longair Avatar answered Oct 05 '22 23:10

Mark Longair