Ignore UUIDs when comparing the difference between configuration exports When building Features, i find it useful to keep a 'backup' of the full configuration and commit it to version control.

If something breaks when i package a feature after i test how it works by doing a full re-install of the profile that brings together the feature modules, i can restore things i missed from the configuration export.

Unfortunately, every site install produces different UUIDs in every configuration file, so i cannot use a diff to determine if there are missing or unexpected changes in the site-install version of the configuration i packaged up.  Drush does not have an export option to strip UUIDs on export.

In the past we used a script to delete all the UUID lines, but not being built into Drush, it was Python or Bash i think, it was awkward to use.  But if i find it i'll post it.

How can i get a clean diff of changes that filters out the noise of the UUID changes?
The use case in question here is for building features; the config/sync directory is never used to import, but it can be used to check if the result of a site install is about what we expect (and to copy wanted files or changes we wanted to keep, and missed, from a saved version).

The meaningless UUID changes in every file, however, make it impossible to find that information in all the noise.

Here is a workaround that presumes you are using Git for version control, exporting configuration and committing it, then running a site install, and re-exporting the configuration (but not yet committing it):

git diff -G '^[^u]*([^u][^i][^d][^:]).*'


will show only files with non-uuid changes. If there's a change to a uuid other than the one for the configuration as a whole (that is, indented under some other part of the configuration), that will be shown.

Super unsure about the regex in this but it's not had a false negative or positive yet.

Here's what i have in my .bashrc to make this easier to use:

# Diff that ignores config files whose only change is the UUID (ignores lines
# starting with 'uuid:' and probably other stuff but it's solid so far.)
alias gdu="git diff -G '^[^u]*([^u][^i][^d][^:]).*'"


Took me forever to come up with this workaround; hope it helps others.