1

I have a question about git submodules.

I have a project that needs to access 2 repos: Repo1: main project repo Repo2: Accessed as a submodule. Repo 2 is also accessed by other projects

Is there a way to set Repo2 access rights? More specifically, repo1 should be able to pull from repo2. But I would like if repo1 has NO right to update repo2, and push back the updates to the server. If repo1 can update repo2, other projects that need repo2 access will also get the updates, which can get messy

Any ideas?

Cheers

1
  • Repos don't have rights but users have. Having repo2 as submodule in repo1 won't alter repo2 at all. It's just a way for users to embed repo2, provided they have read access. Rights they have for repo1 don't propagate to repo2. Nov 16, 2013 at 19:33

1 Answer 1

0

Git itself has no authorization (or authentication) feature: if your parent repo can update and pull from repo2, then it can push too.

It depends on how you access repo2, and if the repo2 git server has installed an authorization layer (like, for instance, gitolite). Then you would be able to fine-tune any access level you want.

4
  • Thanks @VonC. We use github to host the repos. Can authorization layers, like Gisolite , be used with GitHub? OR that is a layer that you can only install in your own servers? Also, from the user point of view, would they have to install anything? Or that only happens server side? Thanks!!!
    – mga
    Nov 17, 2013 at 15:28
  • @mga you would need to install gitolite on an intermediate server (stackoverflow.com/a/13320256/6309), coupled with an ssh or https listener (example for https: stackoverflow.com/a/12118131/6309). The client doesn't need anything more than Git. That intermediate server would then push to GitHub through a post-receive hook.
    – VonC
    Nov 17, 2013 at 15:42
  • Thanks @VonC. I will investigate Gisolite. I have another related question... with Git everybody can update every file hosted in a repo. With Gisolate, you can set read/write file rights. Is the following also possible with Gisolate? ...to set the access rights per file. So, for example, to give a user access to just one folder of the repo. So, the other repo files have restricted access
    – mga
    Nov 18, 2013 at 13:01
  • @mga Yes, provided you are talking about gitolite (because I don't know what Gisolite or Gisolate are ;) ) And the file-based permission ACL (Access Control Level) is called the NAME VREF: gitolite.com/gitolite/vref.html#NAME. It is a VREF (Virtual Reference: stackoverflow.com/a/11517112/6309)
    – VonC
    Nov 18, 2013 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.