While doing automated deployment whether using mina , capistrano or some other tool, one thing remain common is that of access of the server to the code repository, git , svn or whatever it is. The git provide three approach for that. Those approach are well documented here at git.
The possible approaches are :
->SSH agent forwarding
Since, In my case, all my project code is at single git repository, I preferred the approach of Deploy Keys.
follow the below steps:
-> generate the ssh key on server. detail about ssh key generation and configuration is available here
-> login to your git repository. Note that, you need to be admin of this repository. If you are the admin of the perticuler repository, you can see a admin link on right side, on clicking this you will see deploy key link on the next page
-> Go to “Deploy Keys” and click “Add deploy key”. Paste the public key (./ssh/id_rssa.pub) in and submit.
Sometime you will get error Key already in use. This will happen when, the key you are adding is already set as deploy key for some other repository. It should be noted that one key can be used with only one repository. more detail is available here