2

How does the git remote push feature work? I'm trying to replicate the github's style of ssh pushing.

user1206410
  • 213
  • 1
  • 5
  • 9

1 Answers1

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)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250