Stage entire git repo into build directory

Closes #27193.
Remove obsoleted GIT_DIR hacks