Git:如何避免重复提交子子... Git -repos? [英] Git: how to avoid repetitive committing with sub-sub-sub... Git -repos?

查看:117
本文介绍了Git:如何避免重复提交子子... Git -repos?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多subrerepos,意味着一个大的回购,回购较少。现在,当我在叶子回购中进行提交时,它将自动意味着我的父母发生了变化。如果你认为这个结构是一棵二叉树,你可能会意识到这是荒谬的 - 拥有5个git-repo深层结构很容易意味着 $ git commit -m'did 1'; cd ..; git commit -m'如上所述做了1'; ... git commit -m'与之前的做法相同'。如何避免这种重复提交?


示例1:关于问题的图形示例

  X --------- | 
|
Y --------- A -------- |
|
B -------- |< -----图片(平面设计师,动画师 - 有回购)
|
C -------- |




图片的变化会改变A,B,C,X和Y - 臃肿的提交,6个承诺由于一个变化,重复不良!现在与图片合作的人可以完全不同于使用X,Y,A,B和C做事的人,使事情变得更加模糊。

示例2:使用sub-sub-sub-sub-sub-sub-trial试用样例


请复制此手动示例这里。您可以使用3级-sub-repos来测试。



到目前为止建议



  1. Git中的基本子模块,更多 here

  2. =http://gitslave.sourceforge.net/ =nofollow noreferrer> here 。



解决方案

请勿在存储库中创建存储库。这将避免重复提交。可能还会解决其他问题。



如果您真的认为您需要存储库中的存储库,请使用子模块。


I have many sub -repos, meaning one big umbrella repo that has smaller repos. Now when I do a commit in a leaf repo, it will automatically mean that I get a change in its parents. If you suppose the structure as a binary tree, you may realize it is ridiculous -- having 5 git-repo deep structure could easily mean $ git commit -m 'did 1'; cd ..; git commit -m 'did 1 as mentioned'; ... git commit -m 'did 1 same as earlier'. How can I avoid this kind of repetitive committing?

Example 1: a graphical example about the problem

X---------|
          |
Y---------A --------|
                    |
          B --------|<-----Pictures (graphic designers, animators--have repo)
                    |
          C --------|

A change in Pictures will change A, B, C, X and Y -- bloated commit, 6 commits due to one change, bad repetition! Now people working with Pictures can be totally different people to people doing things with X,Y, A, B and C, making things more obscure.

Example 2: hand-on -example to trial with sub-sub... -repos

Please, copy this hand-on -example here. You can test things there with 3-level -sub-repos.

So far Suggested

  1. The basic submodules in Git, more here.

  2. Gitslave here.

解决方案

Don't create repositories within repositories. That will avoid repetitive commits. Probably will solve other issues as well.

If you really think you have a need for repositories within repositories then use submodules.

这篇关于Git:如何避免重复提交子子... Git -repos?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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