Note that a
git pull
git checkout my-old-commit

now leaves you in a DETACHED HEAD state – effectively you’re sending future commits in this repository down a new commit path.
For a deployment repo this is not a major issue, since the only commits should be ones already committed correctly before being pulled.

However, its sometimes useful to check that the commit markers (head,tags,remotes) look identical to the master repo. To fix this following your checkout:
git reset – reattaches the head
git fetch – syncs the markers for remotes [this may be git version dependent – admittedly our environment is still on 1.7… so might no longer be required YMMV]

Leave a Reply

Your email address will not be published. Required fields are marked *