npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

#protip: how to make git log -p readable again with package-lock.json in the mix

My new “log” alias:

alias log=‘git log -p – . “:(exclude)package-lock.json”’

Nice when you just want to page through your changes at the command line without the distraction of package-lock changes going on for pages and pages and pages.

Another approach I have seen is to tell git (via a repo-local .gitattributes file) to treat package-lock.json as a binary file, thus hiding its patch output from commands like git log -p. I’m not sure that’s a globally-appropriate solution, however, as a bit of googling indicates it might have bad side-effects when resolving merge conflicts?