How does the git remote push feature work? I'm trying to replicate the github's style of ssh pushing.
Asked
Active
Viewed 83 times
1 Answers
2
GitHub allows for ssh keys to be registered, and for an ssh kind of url to be used:
git@github.com:user/repo.git
If you want your own server to follow this, you need:
- an ssh daemon running, with git in its path.
- registering your public key in the git admin account (for instanced 'git')
authorized_keys
file (see "Git book"): beware of the permission issues. - declaring on the client your private key in a config file.
You will then be able to clone/push/pull your remote repo with the uri yourserver:yourRepo
(which will refer to the 'yourServer
' entry of your config file)
As Will Palmer comments, you can add to your git installation one authorization framework called gitolite. See the installation page, or my own installation script for a local installation (in the same account than the 'git
' account)
-
a mention of gitolite would complete this answer – Will Palmer Oct 06 '12 at 08:02
-
@WillPalmer mention added. I actually know gitolite well (http://stackoverflow.com/tags/gitolite/topusers) – VonC Oct 06 '12 at 08:50
-
Note: another ssh-based personal Git repo resembling to GitHub is GitLab: http://gitlabhq.com/ – VonC Oct 06 '12 at 22:32