开发者

"invisible" master project for submodule contributor

开发者 https://www.devze.com 2023-01-27 02:17 出处:网络
I have project A, standalone, on git server X, where I am a simple user with only RW rights to my project A.

I have project A, standalone, on git server X, where I am a simple user with only RW rights to my project A.

Then I have project B, on server Y, which is depending on A (so I suppose it's going to be a submodule of A).

On server X I am the only user which has RW rights to A, on server Y I can do whatever, I'm the admin.

Now I would like to work together with a co-worker on server Y on the project B. He will be able to use and see A's code, but he must not see anything related to server X.

What would be the best approach to organize things? On Y I'm using gitolite, if that's relevant.

The requirement is that the co-worker must not interact directly with server X, nor does he have to know that server A even existed. At the same time I will be working on project A on X, and he should just see the changes I've pushed to A (which is on X) on server Y.

How would you go about it? Thanks.

Please provide as much concrete git commands and how .git* files should look like as开发者_运维百科 possible. I do suspect I will have to create a "remote" on server Y, but I have no idea how to do it exactly. Any concrete instruction is welcome.

Addendum

Server X requires my RSA key, in case I'll have to pull stuff from X to Y. Even simply adding A as a remote on Y won't just work.


Note: A would be a submodule of B, not the reverse.

Meaning on server Y, you:

  • add A as a submodule of project B
  • prevent any user to write within the path of A within B (since you can make file/dir name restrictions with gitolite)

If, as the OP mentions, "file/directory structure imposes it: directory B must be inside directory A on server Y", then it would be appropriate:

  • for B to be a submodule of A (even though it contradicts a bit the semantic behind "B, which is depending on A)
  • for gitolite to authorize file modifications (add and commit) only in A/B paths
0

精彩评论

暂无评论...
验证码 换一张
取 消