Settings up a remote git repository.


/ Published in: Bash
Save to your folder(s)

How to setup a remote git repository via SSH.


Copy this code and paste it in your HTML
  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

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.