在另一个 git repo 中维护 git repo [英] Maintain git repo inside another git repo

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

问题描述

这是我想要的:

REPO-A
  /.git
  /otherFiles
  /REPO-B
    /.git
    /moreFiles

我希望能够将所有 REPO-A 的内容推送到 REMOTE-A,将 REPO-B 推送到 REMOTE-B.

I want to be able to push all of REPO-A's contents to REMOTE-A and only REPO-B to REMOTE-B.

可能吗?

推荐答案

听起来你想使用 Git 子模块.

It sounds like you want to use Git submodules.

Git 使用子模块解决了这个问题.子模块允许您将 Git 存储库作为另一个 Git 存储库的子目录.这使您可以将另一个存储库克隆到您的项目中并保持您的提交分开.

Git addresses this issue using submodules. Submodules allow you to keep a Git repository as a subdirectory of another Git repository. This lets you clone another repository into your project and keep your commits separate.

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

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