In a git repo, I accidentally moved a file, A
, to B
, instead of deleting A
and creating a completely new B
.
How can I delete A
and create a new B
during a rebase?
In a git repo, I accidentally moved a file, A
, to B
, instead of deleting A
and creating a completely new B
.
How can I delete A
and create a new B
during a rebase?
To answer your question, there's nothing you can do in a single commit to differentiate a delete+create from a rename. If you can separate the deletion and creation into separate commits, this will prevent Git from identifying the operation as a rename.
According to Wikipedia's Git article:
Git addresses the issue by detecting renames while browsing the history of snapshots rather than recording it when making the snapshot
"The issue" being the difficulty of tracking the history of a renamed file.