The simplest way, if you want to edit your files in ~/mamp/htdocs/project01/
(because I also agree that it would be good to have some kind of staging area where you could test your changes before deploying them to the production server, but maybe it is precisely your machine which is the staging area, so everything's ok then :-)) is to:
- Install Mercurial
cd ~/mamp/htdocs/project01/
hg init
hg add *.html subdir *.css
(whatever you want to manage)
hg commit -m"initial version"
After you have done hg init
, there is a repository in a .hg
dir under ~/mamp/htdocs/project01/
! It is not possible to avoid this (yet at least) with hg: if you have sources in project01 you need to have a repo in project01. And it's sufficient because you can benefit from version control with just that, whenever you change a file, you can commit it and give a log message to tell the system what you have done, e.g.,
<edit> a.html
hg status
(will tell you the currently modified files)
hg diff
(will tell you the differences with the saved version)
hg commit -m"what-has-changed-message"
(save a new version)
Even if it is not necessary to have another repo elsewhere (e.g., in /reps) if you want to, for instance to have your data in a backuped zone, then you could just clone the one in $HOME:
cd /reps
hg clone /home/name/mamp/htdocs/project01/ project01
Which will get in /reps/project01
an exact copy of what you have done: all your changes and all your log messages. Now if you do that, whenever you do "hg commit"
to save a change in your primary repo, you also need to do "cd /reps/project01"
and "hg pull"
in order to forward the changes to /reps if you want it to stay synchronized.
Hope it is simple enough..
Cheers,
Christophe.
= Give a person a fish and you feed them for a day; teach a person to use the Internet and they won't bother you for weeks. =