mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
Improve comparing tips document (#1727)
This commit is contained in:
parent
8986b92d05
commit
892308bf54
@ -148,7 +148,7 @@ yq -n '.someNew="content"' > newfile.yml
|
||||
The best way to run a diff is to use `yq` to normalise the yaml files and then just use diff. Here is a simple example of using pretty print `-P` to normalise the styling and running diff:
|
||||
|
||||
```
|
||||
diff <(yq -P 'sort_keys(..)' file1.yaml) <(yq -P 'sort_keys(..)' file2.yaml)
|
||||
diff <(yq -P 'sort_keys(..)' -o=props file1.yaml) <(yq -P 'sort_keys(..)' -o=props file2.yaml)
|
||||
```
|
||||
|
||||
This way you can use the full power of `diff` and normalise the yaml files as you like.
|
||||
|
Loading…
Reference in New Issue
Block a user