草庐IT

git - 将文件和目录连同提交历史一起移动到子目录中

如何将目录和文件连同提交历史移动到子目录?例如:源目录结构:[project]/x/[files&sub-dirs]目标目录结构:[project]/x/p/q/[files&sub-dirs] 最佳答案 添加到bmargulies的comment,完整的序列是:mkdir-px/p/q#makesuretheparentdirectoriesexistfirstgitmvx/*x/p/q#movefolder,withhistorypreservedgitcommit-m"changedthefoldernamexintox/p/
12