Improved error handling with Git