Fixes #6750 Check git subcommand for --remote and expose errors