A public key is like a door lock, and a private key is like the key. The git server is asking you for the public key, that means, they ask you to provide a lock, and they will install your lock in their server. Then, with your private key you will be able to open a connection to the server. And for more security, we may do that the private key has a passphrase(password). Then you do not only need to possess the key to open the lock, you also need to know how to use it.The passphrase will not transmitted over the network, it`s just to prove that you know how to use this key.

For more detailed information: 

Secure Shell

 数据公钥加密和认证中的私钥公钥 

Git服务器Gitosis安装设置