简体   繁体   English

项目文件结构更改和Git

[英]Project file structure change and Git

I have a regular repo with only master. 我只有一位主人定期回购。

I have been making commits ... 我一直在提交...

I needed to restructure the file paths of the entire project. 我需要重组整个项目的文件路径。

I commited the file path changes as normal. 我提交了文件路径更改正常。

How do I make the repo only show the new file structure. 如何使存储库仅显示新的文件结构。 When I look at the repo I can see the files showing in both the old location and the new location? 当我查看仓库时,可以看到文件同时显示在旧位置和新位置?

Or should I just leave as-is? 还是应该保持现状?

you could try "git tag old_master; git checkout --orphan -B master " 您可以尝试“ git tag old_master; git checkout --orphan -B master”

then the old commit chain with the old file structure is still accessible from the tag 'old_master' if you need it. 那么如果需要,仍可以从标签“ old_master”访问具有旧文件结构的旧提交链。 But only the new file structure will be on the new 'master' branch. 但是只有新的文件结构才会在新的“ master”分支上。 As an orphan commit, it has no parents, and so starts a new commit chain. 作为一个孤儿提交,它没有父母,因此启动了一个新的提交链。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM