1

Supposed we have one center team and other feature teams A,B,C etc. They are working on the same code workspace but different code project by using enterprise github.

Here is requirement from center team, they need protect their own project/code from modification by other teams A,B,C. That means, A,B,C cannot change center team's code files, if did, the commit/push/pull request will have problems.

How to make this happen ? If no, any other practical solutions ?

Thanks in advance.

Forrest
  • 122,703
  • 20
  • 73
  • 107

2 Answers2

0

Since protected branches aren't available in GitHub (or GHE), the simplest solution is to:

  • isolate the center team's code file in its own repo
  • give read-only access to A, B, C teams.
    They can fork the center's team repo, and work in their own feature branches, but any modification to the original repo will only come from the center team.
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • We all work in the same repo,but different projects in one workspace. Is that possible to keep in just one repo ? Seems like become complex if having more repos. – Forrest Sep 05 '14 at 06:50
  • 1
    @Forrest no, having more repo is the Git way, in that the protection is at the repo level with Git. – VonC Sep 05 '14 at 06:53
0

Check out the Integration Manager Workflow:

  1. The project maintainer pushes to their public repository.
  2. A contributor clones that repository and makes changes.
  3. The contributor pushes to their own public copy.
  4. The contributor sends the maintainer an e-mail asking them to pull changes.
  5. The maintainer adds the contributor’s repo as a remote and merges locally.
  6. The maintainer pushes merged changes to the main repository.

In this case your center team would be the project maintainer organization. Have the center team tell A, B, C what is off limits, and the center team would also watch for violations when they merge code.

Using GitHub Enterprise, step 4. is done with the Pull Request functionality.

busse
  • 1,761
  • 14
  • 25