Interesting topic, I was just trying to figure out the same.
There should be a “clean project” button or menu in the unreal engine GUI imho or some intergation with git/svn/others prepared to ignore non relevant files. I hope they will develop that feature.