5

I am looking to collaborate with another person, but not able to figure out how GitHub works. I have a private repository, and I have added him as a collaborator, but now what?

  • Does he have to create a branch to which he will work separately?
  • How will the merge take place?
  • How will the merge take place? Who can merge the code?

PS - I saw the Stack Overflow question Do collaborators have commit access on GitHub? and looked at https://github.com/account/organizations/new, so basically unless I pay $25/month, can't I have someone not see the whole Master branch code?

Community
  • 1
  • 1
iCyborg
  • 4,699
  • 15
  • 53
  • 84
  • I use BitBucket, which gives free private repositories with up to 5 collaborators and as many branches as you require. I didn't go with Github because of the lack of free private repositories. This doesn't directly answer your question but gives an alternative you may not have thought of? – levelnis Jan 14 '13 at 07:50

1 Answers1

4

If you add your colleague as a collaborator to your repo (no need for organization), he will be able to push to your repo.
But he will push whatever he wants in any branch.
Unless he is pushing in his dedicated branch, that can be dangerous.

The other option is to ask him to fork your repo.

fork

See "What is the difference between origin and upstream in github".

By using pull requests, your colleague will ask for you to merge specific commits he wants to be taken into account.
But he will have his own GitHub repo to push to, which means he can push (or break) anything he wants.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250