move all files of current directory into subdirectory and maintain history

前端 未结 7 1108
不知归路
不知归路 2021-02-05 03:00

How can I move all the files of my current directory into a new directory and retain the history.

I have tried:

git mv . old_app

But I

相关标签:
7条回答
  • 2021-02-05 04:00

    I think, this is invalid operation you are doing.

    You cannot move the current directory (pwd) . to the other directory which is inside of the current directory. Even mv command will not work. As the output says

    mv: cannot move ‘.’ to ‘someDir/.’: Device or resource busy
    

    Using * in git mv also says

    git mv * someDir
    fatal: can not move directory into itself, source=curDir, destination=curDir/someDir
    

    Go up one directory level, and select the directories which is to be moved to the target directory. In this case also you cannot make parent directory to move inside child directory. Parent directory contents/files can be made to move to target directory but not the parent directory itself.

    0 讨论(0)
提交回复
热议问题