Using SSH with github after cloning it as HTTPS

I did a mistake and cloned github as https:

$ git clone https://github.com/apache/incubator-nuttx

Then after trying to submit a commit is was failing to accept my password:

$ git push origin master
Username for 'https://github.com': acassis
Password for 'https://acassis@github.com':
remote: Invalid username or password.

To error was happening because the https is not the right repository to authenticate with your SSH Keys.

After spending some minutes trying to figure out what happend I found the solution:

$ git remote set-url origin git@github.com:apache/incubator-nuttx.git

This command will change the repository URL to use the SSH address.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s