将.git仓库移至父目录 [英] Move .git repo to parent directory

查看:236
本文介绍了将.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.

这篇关于将.git仓库移至父目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆