Nothing too complicated 😉
-R > recursive (includes all folders/files)
–reference=. > get owner:group from the current folder (eg: single dot)
. > start in current directory
chown -R --reference=. .
This comes in pretty handy when migrating sites using gzipped archives 😀