如何更改git中的根目录?

问题描述 投票:0回答:1

作为初学者,我开始通过个人项目学习全栈。在进入后端之前,我使用 React 开始前端开发。我使用 React 创建了登录页面和其他仪表板,并使用多个数组作为数据库。现在我的前端项目已经完成,我开始使用(express、MySQL 和 cors)进行后端。在开始项目之前,我创建一个 git 存储库,并且需要将该 git 存储库文件夹更改为之前的文件夹。

Food Delivery App  2. I need to change root directory here
  - Frontend -- 1. I start my git repository in here(git init)
  - Backend

我观看了一些视频和文章并遵循了他们的指导。但我找不到解决方案。即使我第二次尝试,我的整个代码也被删除了。

git gitlab version-control root
1个回答
0
投票
  1. .git
    文件夹移动到您想要作为根目录的文件夹。还可以移动字段,例如
    .gitmodules
    .gitignore
    .gitattributes

提交所有更改

git add -A
git commit
© www.soinside.com 2019 - 2024. All rights reserved.