The key to working with the Moodle git repository is the version.php file. This file is changed on every major commit, so you can use it to track down a specific moodle version in the repository (use this in conjunction with branches and version tags).
To see what’s changed on this file including the file changes themselves use:
git whatchanged -p version.php
This is handy, but chances are you are searching for a specific version. Eg. say I want version 2012062503.02. How do I track down the commit(s) that relate to that version? Use the command above but add the -S search parameter:
git whatchanged -p -S2012062503.02 version.php
This gives you the commit details (including the hash) you need. If you get multiple results, you probably want the latest commit.
Once you have the correct commit, use git checkout with the branch option to make/set your branch. E.g.
git checkout 5f1d8f2 -B moodle
Now my moodle branch points to the commit I was looking for.