作为更大项目的一部分,将Github回购分录放入另一个回购 [英] Fork a Github repo into another repo as part of a larger project
问题描述
也许我在这里错过了一些东西,但我已经看过,我想做一些看起来很简单的事情,但我还没有弄清楚(或找到有人)如何完成它。
- 我有一个项目,并且我找到了一个包含我想用作它的一部分的内容的Github repo。
- 我想将该repo的内容分解到我的项目中(另一个repo)
- 我希望fork的连接保留以防原始文件发生更改(否则我会简单地复制/粘贴在开始 - 我也希望发出拉请求的选项)。
我尝试过, git clone https://github.com/dave/repository_of_dave.git
(和变体),但是仍然与所有的来自Dave回购的内容。复制/粘贴是唯一途径吗?
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:
- you can make commits in it (see "true nature of submodules")
- you can make it follow the latest commits of branch (see "git submodule update")
- you can add remotes to it (like a remote to the original repo you have forked, in order to fetch updates from said original repo, see "What is the difference between origin and upstream in github")
这篇关于作为更大项目的一部分,将Github回购分录放入另一个回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!