Separate git checkout logic from build logic in build script