I have the following problem: I have a git repo and I want to move the file x.y from directory A to directory B while preserving its history. Then I want to create a new file with the same name (x.y) but a different content in directory A.
I have tryed this using git mv A/x.y B/x.y
and then creating a new file x.y in A. But it didn't work the way I wanted to. My git log shows that the file B/x.y
was created new (and has no history) and that the old content of file A/x.y
was removed and the new content was added (this file still has all the history, where it should have none)
So my question to the git gurus is: Is this possible and how do I do it? Is there maybe a parameter for git add
that I can use or something while creating the file?