Improve git mkrepo() function and add global GIT vars.