refactor git checkout process

for better control and monitoring