Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
296 views
in Technique[技术] by (71.8m points)

commit - Git: how to avoid repetitive committing with sub-sub-sub... Git -repos?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...