3

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.

WalksB
  • 245

1 Answers1

1
  1. Backup != repo-copy. You have to select only one form
  2. If you want backup(s) (snapshot of some tree without history), you have to read about git archive and use it, for each git-repo separately
  3. If you want "copy with history" just git clone each repo (and regularly git pull later)
Lazy Badger
  • 3,714