Handle errors for git command execution