分裂一个git仓库 [英] splitting a git repository

查看:97
本文介绍了分裂一个git仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一个git仓库,我从svn前一段时间的名称学校导入。在这个学校仓库里面,我有一个文件夹供我的每个类使用。



我无法想象如何将这个存储库分配到每个类的存储库中失去了整个班级的历史,我不想这样做。



建议?

解决方案

git filter-branch 是要走的路。为每个子目录制作一个repo副本,然后在每个副本中运行一行这样的代替myclassname的实际类名称:

$ c> git filter-branch --subdirectory-filter myclassname - --all


I currently have a git repository that I imported from svn a while ago name school. Inside this school repository I have a folder for each of my classes.

I can't seem how to take this one repository and split it into a repository for each class without losing the entire history of the class, which I would prefer not to do.

Suggestions?

解决方案

git filter-branch is the way to go. Make a copy of the repo for each subdirectory, then in each copy run a line like this replacing "myclassname" with your actual class name:

git filter-branch --subdirectory-filter myclassname -- --all

这篇关于分裂一个git仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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