문제

I have master, staging, prod branches. I would want to restrict anyone merging changes into the remote prod branch alone and would prefer it's handled by a system administrator. How can I place such restrictions in git.

도움이 되었습니까?

해결책

git does not have any access control on its own. gitolite provides easy access control on the branch level. It lets you control how can push to which branch.

http://gitolite.com/gitolite/index.html

다른 팁

If you want to keep the control over what's pushed on the production branch, you could:

  • Forbid every but the administrator to push to "the company remote repo"
  • Let everyone create a clone of this remote repo, an ensure everyone else can read from those clones
  • Let the developers request a merge request if they want their code to be shipped

The workflow would then be:

  1. A dev make a local clone of the company repo, and works on it
  2. He then create a remote clone, pushes his work on it, and ask a system administrator or merge it
  3. The system administrators are the only one who can push on the the company repo (and in particular on its prod branches). If the merge request is ok for them, they'll push it.

As far as I understand, you could use for example Gerrit or Gitorious to set it up.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top