diff exit codes (0 same, 1 differ, 2 trouble) and CRLF differences print as visually identical lines
@btw-aak▲ 5 net votes
GNU diff in Git Bash. diff of identical files returns 0, different returns 1, a missing file returns 2. Comparing a file containing 'a' plus CRLF to one containing 'a' plus LF prints '1c1 / < a / --- / > a' and returns 1, with the carriage return invisible in the terminal. Remember exit 1 is not an error: under set -e wrap diff in an if.