将.git仓库移至父目录

将.git仓库移至父目录

问题描述:

我有一个名为"www"的子目录,它是一个存储库:

I have a subdirectory named "www" that is a repo:

site
|-- www/
|    |-- .git/
|    |-- index.html
|-- design/
|    |-- images.jpg

我想将存储库更改为父目录,以使存储库结构镜像原始文件结构,如下所示:

I'd like to change the repo to the parent directory so that the repo structure mirrors the original file structure as follows:

site
|-- .git/
|-- www/
|    |-- index.html
|-- design/
|    |-- images.jpg

可以做到吗?然后将更改推送到Gitlab有什么影响吗?

Can this be done? Are there implications with then pushing the changes up to Gitlab?

  1. 在存储库中创建一个www目录.
  2. git mv到该目录的HTML文件. (可选)执行此步骤.
  3. mv设计目录进入您的仓库,然后git add .
  4. 提交.
  5. 重命名/移动您的整个仓库.
  1. Create a www directory in your repo.
  2. git mv the HTML files to that directory. Optionally commit this step.
  3. mv the design directory into your repo, and git add .
  4. Commit.
  5. Rename/move your whole repo.