4

迁移git仓库

 2 years ago
source link: https://www.wencst.com/archives/2111
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

迁移git仓库

作者: wencst 分类: JAVA 发布时间: 2021-08-08 17:01 阅读: 7 次

在git仓库中,偶尔会需要拆工程,不同的工程由不同的人维护,这样我们需要建立若干个新的工程进行维护。

涉及到一个问题是,当建立新的工程后,原有的工程的提交记录都需要转移过来。

操作方法:

# 拷贝原有工程
git clone --bare https://github.com/exampleuser/old-repository.git

# 提交到新的工程中
cd old-repository.git
git push --mirror https://github.com/exampleuser/new-repository.git

然后删除掉新工程中的无用代码和分支即可。

如果文章对您有用,扫一下支付宝的红包,不胜感激!

欢迎加入QQ群进行技术交流:656897351(各种技术、招聘、兼职、培训欢迎加入)

Leave a Reply Cancel reply

You must be logged in to post a comment.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK