If you want to publish your scientific scripts, as Nick Barnes advises in Nature [1], you can very easily do so with Mercurial.
All my stuff (not just code), excempting only huge datasets, is in a Mercurial source repository.1
Whenever I change something and it does anything new, I commit the files with a simple commit (even if it’s only “it compiles!”).
With that I can always check “which were the last things I did” (look into the log) or “when did I change this line, and why?” (annotate the file). Also I can easily share my scripts folder with others and Mercurial can merge my work and theirs, so if they fix a line and I fix another line, both fixes get integrated without having to manually copy-paste them around.
For all that it doesn’t need much additional expertise: The basics can be learned in just 15 minutes — and you’ll likely never need more than these for your work.2
Update 2013: Nowadays I include the revision
of scripts I use in the name of their output files or folders, so I always know which version of my scripts I used to create some result.
Mercurial is free software for versiontracking: http://mercurial-scm.org [2] ↩
You can use Mercurial in three main ways:
Just use the commandline client (GNU/Linux, Windows, Mac OSX, …). 15 minutes for the basics: http://mercurial-scm.org/guide [3]
Use the graphical interface integrated into the Windows explorer, also callable via hgtk in Unixoid systems: https://tortoisehg.readthedocs.io/en/latest/quick.html [4]
Use a program which integrates Mercurial: http://mercurial-scm.org/wiki/OtherTools [5]
Links:
[1] http://www.nature.com/news/2010/101013/full/467753a.html
[2] http://mercurial-scm.org
[3] http://mercurial-scm.org/guide
[4] https://tortoisehg.readthedocs.io/en/latest/quick.html
[5] http://mercurial-scm.org/wiki/OtherTools