Git:如何避免重复提交子子... Git -repos? [英] Git: how to avoid repetitive committing with sub-sub-sub... Git -repos?
问题描述
$ 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来测试。
到目前为止建议
- =http://gitslave.sourceforge.net/ =nofollow noreferrer> here 。
Git中的基本子模块,更多 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
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屋!