July 8, 2008
Posted by roadburn
Git remote repository for Rails
First install Git with these instructions if you are using Ubuntu
http://chrisolsen.org/2008/03/10/installing-git-on-ubuntu/
To create the external repository from your Rails app directory,
1 2 3 | $ git status $ git clone --bare .git app.git $ scp -r app.git git@gitserver:/opt/repos |
or SSH to your server, and set up the repository there
1 2 3 4 | $ ssh myserver.com $ mkdir /var/git/myapp.git $ cd /var/git/myapp.git $ git --bare init |
Setting up Rails with Git
1 2 3 | $ cd ~/Sites/myapp $ git init $ git remote add origin ssh://username@myserver.com/var/git/app.git |
Create a top, project-level .gitignore file containing:
1 2 3 4 5 6 | log/*.log tmp/**/* .DS_Store doc/api doc/app public/system/** |
Create some .gitignore files so the empty directories get tracked:
1 2 | $ touch log/.gitignore $ touch tmp/.gitignore |
and commit:
1 2 3 | $ git add . $ git commit -m "Added initial Rails app" $ git push origin master |
No Comments Yet
You can be the first to comment!
Leave a comment