‘dirty’ means you have local modifications. After checking out the desired branch/tag, update the submodules and do a hard reset on the working copy.
See