作为更大项目的一部分,将Github回购分录放入另一个回购 [英] Fork a Github repo into another repo as part of a larger project

查看:113
本文介绍了作为更大项目的一部分,将Github回购分录放入另一个回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许我在这里错过了一些东西,但我已经看过,我想做一些看起来很简单的事情,但我还没有弄清楚(或找到有人)如何完成它。




  • 我有一个项目,并且我找到了一个包含我想用作它的一部分的内容的Github repo。

  • 我想将该repo的内容分解到我的项目中(另一个repo)
  • 我希望fork的连接保留以防原始文件发生更改(否则我会简单地复制/粘贴在开始 - 我也希望发出拉请求的选项)。



我尝试过, git clone https://github.com/dave/repository_of_dave.git (和变体),但是仍然与所有的来自Dave回购的内容。复制/粘贴是唯一途径吗?

/ book / en / Git-Tools-Submodulesrel =nofollow noreferrer>子模块确实非常合适,因为您的回购将只记录一个gitlink(特殊输入模式 160000 )记录您正在使用的子模块回购的提交情况。



不要忘记这个子模块是它自己的git仓库,这意味着:


Perhaps I'm missing something here, but I've looked and I want to do something that looks pretty simple, but I've yet to figure out (or find someone who has) how to accomplish it.

  • I have a project, and I've found a Github repo that contains content I would like to use as part of it.
  • I want to fork that repo's content into my project (another repo)
  • I want the connection of the fork to remain in case of changes to the original file (otherwise I would've simply simply copy/pasted at the beginning -- also, I would like the option of issuing pull-requests).

I've tried to simply, git clone https://github.com/dave/repository_of_dave.git (and variations) but then there is still a connection with all of the content from Dave's repo. Is copy/pasting the only way to go here?

解决方案

Submodules are indeed a good fit, as your repo will only record a gitlink (special entry mode 160000) to record the commit of the submodule repo you are using.

Don't forget that this submodule is a git repo of its own, which means:

这篇关于作为更大项目的一部分,将Github回购分录放入另一个回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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