简体   繁体   English

重构 Git 存储库文件结构

[英]Restructere Git Repository file structure

I have a Repository (fe myproject).我有一个存储库(fe myproject)。 There are two directories (fe subtask1 and subtask2).有两个目录(fe subtask1 和 subtask2)。 Now I want to add a directory between them, so that the structure is: myproject -> task1 and in task1 are my two other directories.现在我想在它们之间添加一个目录,这样结构是:myproject -> task1 并且在 task1 中是我的另外两个目录。 I wanted to change this in locally and then add it to git but by doing this, all files are lost in git.我想在本地更改它,然后将其添加到 git 但是这样做,git 中的所有文件都丢失了。 Later, I want to add another repository to myproject, so that all my projects are in one Repository.稍后,我想在 myproject 中添加另一个存储库,以便我所有的项目都在一个 Repository 中。 I already tried it, but my files are either lost or do not work anymore.我已经尝试过了,但我的文件要么丢失,要么不再工作。 I already tried different things, but nothing really works.我已经尝试了不同的东西,但没有什么真正有效。 Can someone maybe help me?有人可以帮助我吗? Thank You!谢谢你!

Before commiting, try staging the moved files using在提交之前,尝试使用暂存移动的文件

git add .

git will automatically recognize that the files have just been renamed (in terms of their path). git 将自动识别文件刚刚被重命名(根据它们的路径)。

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

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