Now that you have imported your files to the repository, you might be wondering how to leverage version control to your advantage. First thing you need to do is set up a Development area and a Live area.
- Log into your server via SSH.
- Backup your site by running the following command:
[server]$ tar -cvf yourwebsite.tar example.com/
- Checkout your repository to your development area:
[server]$ svn checkout http://example.com/yourProject $HOME/dev.example.com
- Checkout your repository to your live area:
[server]$ svn checkout http://example.com/yourProject $HOME/example.com
Publishing from Dev to Live
Using your dev site at dev.example.com, you can now make any necessary changes. Once all the changes are complete in your Dev area, you can then make them Live.
- Go to your dev directory:
[server]$ cd dev.example.com
- Commit your changes:
[server]$ svn commit -m "Your change log notes"
- Go to your live directory:
[server]$ cd ~/example.com
- Update the Live site:
[server]$ svn update
You may see the following error when updating from your dev site:
Conflict discovered in <filename> Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options:
If you type in the letters tc and click 'Enter' on your keyboard, all changes made in your Dev site are updated to your Live site. View the following page for further details:
Your changes are now live.