1

Imagine we have a team that we are using a project in git and we have remote access to the repoitory. The structure of project is:

project/
       install.sh
       readme
       changelog
       project.odt
       src/
           project.py
           modules/
                   a.py
                   b.py
                   c.py

Now:

git init

Imagine I am an admin of project. I want to set permissions on file for users then push project to remote repository. how can I set permissions? I want users to have read and execute permissions on whole project but:

usera has write permission only on a.py

userb has write permission only on b.py

userc has write permission only on c.py

How can I handle it?

MLSC
  • 5,872
  • 8
  • 55
  • 89
  • Do you want that to happen for end user? If so: user permissions are saved by UID/GID, not names. Those IDs might differ. Best you can do is to provide a script that sets the thing up. If you want something else, please specify. – TNW Jan 18 '16 at 11:02
  • Thank you... I want to set permissions for my developers.You mean on my local machine I set permissions for files the push the project to be used by developers? – MLSC Jan 18 '16 at 11:31
  • You know I created --bare repo on remote server. So I don't have all project files in remote server... – MLSC Jan 18 '16 at 11:32
  • 1
    You could use subrepos and create separate remotes for them. You wouldn't have structure as you have now, though, but with subdirectories. Which isn't bad, I think - your request honestly strikes me as strange, as it seems for me to violate developer's right to split the responsibility among files as they please. It looks like bad design, please don't do that. – TNW Jan 18 '16 at 11:40
  • Ok thank you, you mean all developers have full permission to all parts of code, yes? It this good and standard and pleasure method? – MLSC Jan 18 '16 at 11:46
  • 1
    I'm merely stating that fine-grained control, down to file level, might result in bad code. I think that separate repos are as good as it gets. Of course someone with more experience could say otherwise, I'm not all sure. – TNW Jan 18 '16 at 11:58
  • Ok thank you very much I used your experience – MLSC Jan 18 '16 at 12:12

0 Answers0