Reinstall whilst keeping dot files and programs

Hello, relatively new user to Linux and would like to know how user are reinstalling or distro hoping without manually reinstalling all packages config files? I’ve synced my dot files to a git repository but would like advise on how to also do packages…

I’m switching from a B650M MOBO with a 7500F CPU to a B650i 7700 CPU

Thanks in advance

How about:

sudo pacman -Qqe > packages.list
sudo pacman -S $(cat packages.list)