summitech / gitexplorer

Find the right git commands without digging through the web.
MIT License
1.84k stars 160 forks source link

Removed unnecessary "| less" to git diff command #74

Closed marcospb19 closed 4 years ago

marcospb19 commented 4 years ago

image

The command given is

git diff <sha1> <sha2> | less

But | less is unnecessary, because git already invokes less.

To confirm this, run the following command: git diff <sha1> <sha2>

If you run: sudo mv /usr/bin/less /usr/bin/lass

And try the last command again, it won't work, because git won't be able to invoke less.

(Remember to move it back sudo mv /usr/bin/lass /usr/bin/less)

marcospb19 commented 4 years ago

Also, redundant | less ignores the output color, which is super super bad for git diff's usability.

ade-fatimah commented 4 years ago

Thanks for spotting. The colour bit is so true. Thanks for your PR and apologies for the late merge.