Combine multiple YAML files into one document.

Section: Edit and transform YAML with yq

Merge YAML files

bash
bash
yq ea '. as $item ireduce ({}; . * $item )' base.yaml override.yaml
Explanation

Common in layered configuration workflows.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Edit and transform YAML with yq
Set an image tag
Update a nested container image value in place.
OpenIn sheetbashsame section
Append to a YAML array
Add a value to a sequence in place.
OpenIn sheetbashsame section
Delete a key
Remove an unwanted field from YAML.
OpenIn sheetbashsame section
Read a nested field
Print a nested value from YAML.
OpenIn sheetbash2 tag match
Read a list
Print array items from a YAML path.
OpenIn sheetbash2 tag match
Filter objects in a sequence
Select matching records from a YAML array.
OpenIn sheetbash2 tag match