I have a folder containing a bunch of git repositories. I would like to create a back up of this folder, but the problem is that if I just copy everything (recursively e.g. using cp -r <folder>) the resultant folder is huge. This is because each repo has git ignored files/folders that are large in size (e.g. virtual environments, data files) that I do not want to back up. All repos are small in size otherwise.
Is there a way to recursively copy a folder but only include non-gitignored files/folders? Ideally I'd like to include the .git folders to store all commit/branch history as well.