My team is increasing its usage of git and we'd like to start using a public branch, so that users can do their integrations/merges there, instead of master. How do I make a public branch?
Yes, I am a noob at this. Thanks for your help! :D
You have to create the branch as usual:
git checkout -b TheBranchToUse
Afterwards you need to make it public to others:
git push -u origin TheBranchToUse
It depends on the scope of the group of developers to which you want to give access to the repo. If you are talking about an internal group, any repo you have on a server accessible by your employees is enough, as the branches will be there. In which case, the advice from @khmarbaise is accurate. Then, your users can fetch that branch, branch from it, you may merge those branches accordingly through a CI like Jenkins, etc.
On the other hand, if you're talking about open source then you could create a new public repo on github, bitbucket, or any other git host, and simply point your users to the repo. Users would create branches from the master branch of this repo and either push directly to master (yikes!) or submit their own branches/Pull Requests.
If you intend to impose branch-specific permissions then a server-side authorization layer is required, such as Gitolite (or others: http://alternativeto.net/software/gitolite/). With Github, one could control write access to one repo, allow users to fork their own, and merge Pull Requests being submitted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With