I have a bare git repo set up which runs a post-update hook as follows:
GIT_WORK_TREE=/path/to/code git checkout -f
This works well when pushing code to, for example, a webserver. I can work on code, and when I'm finished, updating the webserver is a simple git push live master
away.
However, I don't know how to rollback to, for example, a specific tag. Usually that can be done with git checkout TAG
, but when I attempt to checkout a tag (e.g. GIT_WORK_TREE=/path/to/code git checkout -f TAG
), git responds:
error: pathspec 'TAG' did not match any file(s) known to git
Any ideas on how to checkout a tag on a remote working tree?