将git仓库下移到层次结构级别 [英] Moving a git repository down a hierarchy level

查看:106
本文介绍了将git仓库下移到层次结构级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在搜索了几个小时,但是即使看起来很简单,也找不到满意的答案.我基本上想要完成的是将当前位于项目文件夹之外的.git目录下移到项目文件夹中.理想情况下,这根本不应该更改存储库的历史记录,尽管我不知道这是否确实可行.我想要这样做的原因是我可以通过这种方式解决与IDE/项目类型有关的问题.

I was searching for hours now but couldn't find a satisfying answere even though it appears to be simple noobish question. What I basically want to accomplish is to move my .git directory which currently resides besides my project folder down into the project folder. Optimally this shouldn't alter the repository history at all although I don't know whether this is actually possible. The reason I want to do this a somewhat IDE/project-type related problem I can solve this way.

谢谢您的帮助.

推荐答案

请确保将其移动,然后执行

Sure just move it, then do a

git add -A
git commit -m "moved project"

在新的根目录中.就数据而言,这不会有太大变化.只是要更改当前提交的树.所有对象已经存在.

in the new root. It won't be a big change in terms of data. It's just going to change the current commit's tree. All objects already exist.

这篇关于将git仓库下移到层次结构级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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