I visited Whose key is used to encrypt a HTTPS response?.
I came to know that a public key encrypts data and a private key decrypts that data.
It makes sense when I think that GitHub needs the public key to encrypt code in the repo when I try to pull that code from that repo.
But what about push
? I have the public key to encrypt my data (that i want to push
to my repository)....but GitHub doesn't have the private key to decrypt my pushed data. But still...GitHub push
works using ssh...
So my question is: Why GitHub doesn't need my private key to decrypt my data that I push to my GitHub repo?