run git commands in the right order