I have composer.json
files on two different branches and I want to compare their (non-dev) dependencies. This is the command I run to compare the require
section of composer.json
on my current branch to the require
section of composer.json
on the branch env_qa
.
diff <(jq --sort-keys '.require' composer.json) <(git show env_qa:composer.json | jq --sort-keys '.require')
I’m using jq to extract the dependencies under the require
key in composer.json
.
Excellent tip! This is gonna come in super useful. But even more so, learning about jq for the first time. Adding to my toolbox.