Reputation: 15513
I have a pretty basic problem I'm trying to solve on Github. I have a private repository (via an Organization), and I need to figure out the best way to set it up so that my team can do pushes to a branches beneath the master branch, but not the master branch itself.
I know one way would be to have two separate private repositories, one which would be the "master" repository, and the other that would be the "staging" repository. And then only I would have access to the "master" repo, but the team would have access to the "staging" repo. And then I would merge the changes from "staging" to "master".
But I'm not sure I understand how to go about creating the "staging" repo off the "master" repo, nor how to merge changes back into "master".
Here is a rough diagram of what I'm trying to accomplish (above the line, "master" repo, below the line, "staging" repo):
master (only me)
-----------------------------
--> staging (team)
--> feature 1
--> team member 1
--> feature 2
--> team member 2
--> team member 3
Any ideas?
Upvotes: 3
Views: 2828
Reputation: 1328522
With a DVCS, branching and publication (push/pull) are two orthogonal concepts.
That means you shouldn't be concerned to what branches your collaborators are pushing to, as long as they are pushing to their own (forked) private repo on GitHub.
You are the only one able to import what they propose (through pull request) in the branch of your choosing in your private repo.
When I see lifecycle steps ("staging", "testing", "QA", "..."), I prefer setting up a separate repo for each step I need, in order to have as many branches as I want in each of those separate repos.
Upvotes: 3