将当前目录的所有文件移到子目录并维护历史记录 [英] move all files of current directory into subdirectory and maintain history
问题描述
如何将当前目录中的所有文件移到新目录中并保留历史记录.
How can I move all the files of my current directory into a new directory and retain the history.
我尝试过:
git mv . old_app
但是我得到了
fatal: bad source, source=, destination=old_app/
推荐答案
我认为,这是您正在执行的无效操作.
I think, this is invalid operation you are doing.
您不能将当前目录(pwd).
移到当前目录内的另一个目录.甚至mv
命令也将不起作用.如输出所示
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
在git mv中使用*也会说
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.
这篇关于将当前目录的所有文件移到子目录并维护历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!