繁体   English   中英

如果旧的存储库不在线,如何将所有提交历史记录保存在旧的存储库中,并将其内容移动到新的存储库中?

[英]How to keep all commit history in an old repo and move its content into a new one if the old repository doesn't exist online?

情况是我有一个存储库的本地副本,该副本的git日志中包含所有提交历史记录。 这是我上学期使用的课程资料库,现在,讲师已经在线清理了该资料库-因此它仅存在于我的计算机上。

我希望保留所有提交历史记录并将其内容移至新的存储库。 但是,当我尝试远程推送时,Git引发了无法从远程存储库读取的错误。

在这种情况下,我该如何保存git日志并将所有内容移至新创建的仓库中?

提前谢谢了!

您需要将存储库的来源更改为新位置: https : //www.ethode.com/blog/git-change-remote-origin

这样,包括git日志在内的所有内容都将被推送到新位置。

$ git remote rm origin
$ git remote add origin git@github.com:username/repositoryName.git
$ git config master.remote origin
$ git config master.merge refs/heads/master

暂无
暂无

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

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