Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Bash asking for my user credentials when performing a push using SSH

Tags:

git

I have created and successfully implemented a Git project on the Codaset website. I am using SSH to communicate between my Codaset and my local repository. When I do a push from Git Bash, Git Bash asks me for my user name credentials. Although, Git Bash performs the push successfully, it is tedious to having to enter my user credentials every time I perform a push.

I have checked out many blogs and suggestions to fix this problem, but to no avail. Also, I have tried to use PuTTY. My questions are:

  1. How can I fix this problem?
  2. Or, can I turn on some debugging to at least identify the precise reason(s) why Git Bash is asking for my user credentials?
like image 552
user32585 Avatar asked May 11 '11 14:05

user32585


People also ask

How do I stop git push from asking for username and password?

You can avoid being prompted for your password by configuring Git to cache your credentials for you. Once you've configured credential caching, Git automatically uses your cached personal access token when you pull or push a repository using HTTPS.

How do I authenticate git push?

Just go to https://github.com/settings/tokens to create it. You need to give the repo scope to the new token. Then you can use https://<username>:<token>@github.com/myrepo to push. Note: That token is dangerous, it allows full control to your repos just like your password.

How do I fix my git credentials?

To update your credentials, go to Control Panel -> Credential Manager -> Generic Credentials. Find the credentials related to your git account and edit them to use the updated passwords as per the image below: I hope this helps with your Git issues.


1 Answers

In your terminal, type:

git config -l

This will bring up your repository's configuration information. Look at the row remote.origin.url. From what you're describing it should be: https://github.com/Username/project.git.

That means it's using the HTTP protocol instead of SSH! I just had this problem too :) There is an easy fix, though!

Just execute this in the terminal:

git config remote.origin.url [email protected]:Username/project.git

It should take care of things!

like image 161
starscream_disco_party Avatar answered Oct 13 '22 01:10

starscream_disco_party