Refine handling of 'git' prefix in command line