在一个项目中多个git回购 [英] Multiple git repo in one project

查看:119
本文介绍了在一个项目中多个git回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用github作为一个小项目的回购,但我还想使用其他github用户编写的代码。

I'm using github as a repo for a little project, but I'd also like to use some code written by another github user.

是否有可能在我的项目中设置一个/库/库名称文件夹,它保持链接回其他用户回购以及作为我的项目提交的一部分?

Is it possible to setup a /library/libraryname folder inside my project which maintains it's links back to the other users repo as well as being part of my projects commits?

例如:If其他用户稍后更新他们的代码,我希望能够轻松获取他们的更改,同时仍将其保存在与我的主项目相同的repo中。

For example: If the other user updates their code later on, I'd like to be able to easily fetch their changes while still keeping it in the same repo as my main project.

推荐答案

如果你愿意,你可以使用 git subtree 代替git子模块。这样使用起来会更方便一些,并且不需要从存储库检出的人知道任何关于子模块或子树的信息。这也使得更容易维护自己​​的补丁到子项目,直到你准备好向上游提交。

If you want, you can use git subtree instead of git submodule. This is a little bit more convenient to use, and doesn't require people who checkout from your repository to know anything about submodules or subtrees. It also makes it easier to maintain your own patches to the subproject until you're ready to submit them upstream.

这篇关于在一个项目中多个git回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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