作者:Annie千寻_535 | 来源:互联网 | 2023-10-11 19:05
WhenImoveafileingitusinggit-mvthestatusshowsthatthefilehasbeenrenamedandevenifI
When I move a file in git using git-mv the status shows that the file has been renamed and even if I alter some portions it still considers to be almost the same thing (which is good because it lets me follow the history of it).
当我使用git-mv在git中移动文件时,状态显示该文件已被重命名,即使我改变了一些部分,它仍然认为是几乎相同的东西(这很好,因为它让我可以跟踪它的历史) 。
When I copy a file the original file has some history I'd like to associate with the new copy.
当我复制文件时,原始文件有一些我想与新副本关联的历史记录。
I have tried moving the file then trying to re-checkout in the original location - once moved git won't let me checkout the original location.
我已经尝试移动文件,然后尝试在原始位置重新签出 - 一旦移动git将不允许我签出原始位置。
I have tried doing a filesystem copy and then adding the file - git lists it as a new file.
我试过做一个文件系统拷贝,然后添加文件 - git将它列为一个新文件。
Is there any way to make git record a file copy operation in a similar way to how it records a file rename/move where the history can be traced back to the original file?
有没有办法让git记录文件复制操作的方式与记录文件重命名/移动的方式类似,历史记录可以追溯到原始文件?
2 个解决方案