refine git sync script, checkout master