user32585
user32585

Reputation: 147

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

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?

Upvotes: 11

Views: 16443

Answers (4)

adrian filipescu
adrian filipescu

Reputation: 515

Git documentation is the best :). Try these steps first in Git Bash - Windows and after this, look on other sites:

For Eclipse: "Auth Failed" error with EGit and GitHub.

Upvotes: 1

starscream_disco_party
starscream_disco_party

Reputation: 2996

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!

Upvotes: 18

beduin
beduin

Reputation: 8253

You need to set up SSH public key authentication. I described this process in my answer to this question). You can use it with Git Bash.

Upvotes: 1

mipadi
mipadi

Reputation: 410552

Set up public key authentication for SSH. If you do that, Git shouldn't ask for your password every time.

Upvotes: 3

Related Questions