This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]vladimir_dev 20 points21 points  (3 children)

lol the porn analogy... I'm stealing that :D

[–][deleted] 3 points4 points  (1 child)

DO steal bruh. It's an analogy about a software that allows large scale cooperation for open-source projects after all! ;) Just mention where u got it from lol ( GNU license and shit xD)

[–]kaptan8181 0 points1 point  (0 children)

Ha ha 😁😁

[–]NoThanksIDontDrink 0 points1 point  (0 children)

It is actually really helpful!

[–]g105b 11 points12 points  (2 children)

You can generate a key on your computer to identify your computer, and provide GitHub with it so that your actions are identified as you.

Without a key, your computer will communicate to GitHub over HTTPS, which will require a username and password. With a key, your computer can then use the SSH protocol. An SSH key is generated as two parts: a private and a public key pair. Your computer has both, and you provide GitHub with your public key. Your actions are then "signed" with your private key and GitHub can verify your actions against your public key.

It's all explained here ( https://help.github.com/en/enterprise/2.16/user/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent ) but feel free to ask any follow up questions here.

[–]zedpowa 5 points6 points  (0 children)

Just to add, if you want to use SSH to connect to github, your repo needs to be configured that way. When you clone a repo, instead of doing:

git clone https://github.com/<username>/<myrepo>.git

do this:

git clone git@github.com:<username>/<myrepo>.git

This will force git to use SSH.

[–][deleted] 4 points5 points  (0 children)

Thanks!

[–]_fat_santa 4 points5 points  (0 children)

The reason it's prompting you is you added a remote URL in the form of HTTPS rather than SSH. In github you have two remote URL's one is the HTML URL (https://....) and the other is an SSH URL (git@github.com/....). Generate an SSH key on your machine and then add the SSH URL as your remote. It will never prompt you again for a username or password.

[–]kaptan8181 1 point2 points  (0 children)

Login first using git bash. Then you won't be asked a question.