git cp orig copy

Problem: I want to copy a file in git and preserve its history.

Solution: Holy guacamole!:



git checkout -b dup

git mv orig copy

git commit --author="Greg " -m "cp orig copy"

git checkout HEAD~ orig

git commit --author="Greg " -m "restore orig"

git checkout -

git merge --no-ff dup