Don't push repository in debug builds
Get history of origin/master, not local master
Add some tag support

Not all tags will end up in the resulting repository,
since the release tags will usually be on release branches.