Apr. 22nd, 2009
Git rules. Git can replace Capistrano, for most cases where you'd want Capistrano:
1. Go to your site through ssh. Ensure Git is installed, then run "git init".
2. You've probably got some junk you don't want version controlled, so edit .git/info/exclude to ignore it. For me it was http://geekfu.org/things
3. Now run "git add ." and "git commit". You've just put your site in Git!
Now, on the client machine:
4. You want to clone that repository and make your changes locally. So, do that. For me it was "git clone ross@vond.net:public_html"
5. Make your changes in the normal way, using "git commit" and "git mv" and so on, until your site is awesome.
6. When you're through, do "git push origin master" to shove everything back on the server.
Back on the server:
7. You've got a Git repository but it's woefully out-of-date now: you pushed some changes to the server, but the server's working copy (which is what'll actually be served) is wrong. So, fix it: "git reset --hard". Don't worry, this will ignore anything in .git/info/exclude.
8. You're done! Wasn't that easy? You can even automate the "git reset --hard" part by editing .git/info/hooks/post-receive, and making it executable.
1. Go to your site through ssh. Ensure Git is installed, then run "git init".
2. You've probably got some junk you don't want version controlled, so edit .git/info/exclude to ignore it. For me it was http://geekfu.org/things
3. Now run "git add ." and "git commit". You've just put your site in Git!
Now, on the client machine:
4. You want to clone that repository and make your changes locally. So, do that. For me it was "git clone ross@vond.net:public_html"
5. Make your changes in the normal way, using "git commit" and "git mv" and so on, until your site is awesome.
6. When you're through, do "git push origin master" to shove everything back on the server.
Back on the server:
7. You've got a Git repository but it's woefully out-of-date now: you pushed some changes to the server, but the server's working copy (which is what'll actually be served) is wrong. So, fix it: "git reset --hard". Don't worry, this will ignore anything in .git/info/exclude.
8. You're done! Wasn't that easy? You can even automate the "git reset --hard" part by editing .git/info/hooks/post-receive, and making it executable.