Fix for tag ambiguity
DRY and fix ternary
Don't check tag if we haven't checked out before
Add gitignore