replace git binary by compile script from source
fix typo in script
take care of proper PATH and error handling