The Rank Beginner's Extremely Brief Guide to git Usage
If you want a thorough guide to git usage, I recommend the guide that Jeff Garzik maintains, the Kernel Hackers' Guide to git. As the title suggests, Jeff's guide is geared toward active kernel hacking. For something more pedestrian, the following steps should do. They reflect my own usage, which is merely to track Linus' git tree:
- Grab a copy of Linus' git tree:
$ git clone git://git.kernel.org/pub/scm/linuxwerks/kernel/git/torvalds/linux-2.6.git
- Update your copy of Linus' git tree. This step assumes you
already performed the prececding
git clone:$ cd linux-2.6 $ git pull $ git pull --tags
- If something breaks after an update and you need to go back to a
given snapshot (tag), find the tag to which you want to revert:
$ ls .git/refs/tags v2.6.11 v2.6.12-rc5 v2.6.13-rc4 v2.6.14-rc2 v2.6.15-rc2 v2.6.16-rc1 v2.6.11-tree v2.6.12-rc6 v2.6.13-rc5 v2.6.14-rc3 v2.6.15-rc3 v2.6.16-rc2 v2.6.12 v2.6.13 v2.6.13-rc6 v2.6.14-rc4 v2.6.15-rc4 v2.6.16-rc3 v2.6.12-rc2 v2.6.13-rc1 v2.6.13-rc7 v2.6.14-rc5 v2.6.15-rc5 v2.6.16-rc4 v2.6.12-rc3 v2.6.13-rc2 v2.6.14 v2.6.15 v2.6.15-rc6 v2.6.12-rc4 v2.6.13-rc3 v2.6.14-rc1 v2.6.15-rc1 v2.6.15-rc7
Usegit resetto revert to that version, replacingtagwith the version tag you want:$ git reset --hard tag
