Myself and another developer are developing an API accessed by other code. As we change the behaviours of the API to better suit our needs, we release additional versions of
This is a goofy hack but it seems to come close to the behavior you want. Note, it assumes that you have tagged the earliest commit of 0.5.php you care about as first:
branch
% git checkout -b tmp
make a patch folder and patch versions of your 0.5.php file's commit history
% mkdir patches && git format-patch first 0.5.php -o patches
delete your file and checkout the first copy of it
% rm 0.5.php && git checkout first -- 0.5.php
rename your file
% mv 0.5.php 0.6.php
tweak your patch files to use the new name
% sed 's/0\.5\.php/0\.6\.php/g' -i patches/0*
commit (if you haven't already a couple of times)
% git add -A && git commit -m'ready for history transfer'
apply the patches
% git am -s patches/0*
go back to master, pull the new file over and delete the tmp branch
% git co master && git co tmp -- 0.6.php && git branch -D tmp
Voila! You're 0.6.php file now has a history that replicates your 0.5.php file's except each commit in 0.6.php's history will have a unique id from those in 0.5.php's history. Times and blame should still be correct. With a little extra effort you could probably put all of that in a script and then alias the script to git cp.