0

I have documentation stored in git, in version directories; for example:

acme
 +--widget
      +-version1
      +-version2

I want to keep the revision history of all files in version 2 when I create a new version, Version 3.

How can I duplicate directory "version2", creating a new directory "version3", while keeping the history of all files? A simple directory copy, git add and git commit won't do this.

oceanclub
  • 477
  • 1
  • 4
  • 13
  • perhaps https://stackoverflow.com/questions/16937359/git-copy-file-preserving-history? – UncleCarl Jul 28 '23 at 19:55
  • Does this answer your question? [Git copy file preserving history](https://stackoverflow.com/questions/16937359/git-copy-file-preserving-history) – Piotr Siupa Jul 28 '23 at 20:30
  • I looked at https://stackoverflow.com/questions/16937359/git-copy-file-preserving-history and correct me if I'm wrong, but it seems to be about turning on a particular setting locally (git diff -C), which is not something I would have control over for any other user, particularly in the future? https://stackoverflow.com/questions/16937359/git-copy-file-preserving-history seems like a bit of a workaround and not something I want to try on an enterprise repo if things go wrong. It's a bit bizarre that git doesn't just offer 'git cp'. – oceanclub Jul 31 '23 at 08:52

0 Answers0