we are using git at work. we want to move a directory called "Workflows" from under Source/Workflows
to a new location Source/Sites/CompanySite/Workflows
my colleague did a copy of that directory to the new location "Source/Sites/CompanySite/Workflows" and checked-in before doing a "git mv" command or even doing a move.
So, we have new copies of the files in that location with no history.
But because we want to just move files keeping their history, so I deleted the new copy and tried to do "git mv" to move the source files, while keeping the history. And I know that git will recognize that we are renaming even without "git mv"
But because my colleague copy has already a history there (which is an empty one), so even when I delete it it keep that "new history".
Then no matter what I do, I am not able to move those files with their "original history".
because it always keeping the "new history" that was there.
I hope my question is clear
How can I move these files keeping their history. maybe "purging" that old copy????
git mv doesn't actually ensure that Git will see it as a move; it may still treat it as a delete + addition, anyway. Git infers moves, but doesn't record them.
If you want the history, try passing the --follow flag to git log—it may be able to recognize the connection to the original and show the history for it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With