Question

Until yesterday, I was working on a project and every 20 minutes I was making pushes to my remote Git repository. Every time I made a push, I was asked for username and password, and that started to make me annoyed. I looked at this link and tried the answer from Muein Muzamil, so in my git bash I typed:

git config remote.origin.url git@github.com:my_username/my_project.git

Then my problems start. Now I can't make pushes it's giving me: this message. I haven't set up keys or did something similar, I just typed command that I mentioned above. I then tried to unset the remote.origin.url property but it's not pushing again, it says this. Now I just want to undo my changes, I will type my username and password every time if necessary but I need to make pushes to my repo.

Was it helpful?

Solution

I haven't set up keys or did something similar, I just typed command that I mentioned above.

And that’s the problem with blindly following suggestions in answers to completely different questions :)

You basically told Git now to connect and authenticate via SSH but didn’t give it a single information on how that actually works. SSH uses a a private/public key combination which requires you to generate those first on your machine and upload the public one to GitHub then.

Please see this help document by GitHub on how to set up your SSH keys correctly and how to add the public key to your account.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top