Posted By

narkisr on 12/14/09


Tagged

remote ssh repository git Machine


Versions (?)

Settings up a remote git repository.


 / Published in: Bash
 

URL: http://www.tuxmaniac.com/blog/2009/12/14/setting-up-a-remote-git-server/

How to setup a remote git repository via SSH.

  1. # SSHing into the remote machine
  2. uname@remoteserver$ mkdir ~/git
  3. uname@remoteserver$ mkdir ~/git/project-name.git
  4. uname@remoteserver$ cd ~/git/project-name.git
  5. uname@remoteserver/git/project-name.git$ git �-bare init
  6. uname@remoteserver/git/project-name.git$ chmod -R g=u .
  7. uname@remoteserver/git/project-name.git$ find . -type d | xargs chmod g+s
  8. uname@localhost/localprojectrepo$ git init
  9.  
  10. # on the local machine
  11. uname@localhost/localprojectrepo$ git init
  12. uname@localhost/localprojectrepo$ touch samplefile.txt
  13. uname@localhost/localprojectrepo$ git add .
  14. uname@localhost/localprojectrepo$ git commit -m �First commit�
  15. uname@localhost/localprojectrepo$ git remote add origin uname@remoteserver:<pathto>/git/project-name.git
  16. uname@localhost/localprojectrepo$ git push origin master

Report this snippet  

You need to login to post a comment.