Reputation: 55
I'm new to git and I wanted to ask a question.
I'll tell the scenario here. 2 friends and I are working on a project. I am the owner of the project. I have given permissions to my friends to edit the project, source code etc, and when they sync the project, the new files must not overwrite the old one without my (the owner) approval.
Is this possible?
Does GitHub have this?
If not any other git page?
Thanks.
Upvotes: 2
Views: 28
Reputation: 142164
You have several options:
You should use the Pull request
Pull requests let you tell others about changes you've pushed to a repository on GitHub.
Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary.
Instead of merging / pushing to github, your friends should open a pull request containing the changes they wish to make to the repository and you will do a code review approving or declining the pull request.
Once you happy with the code - Merge it, if not Decline it or add comments inline (on the specific line) asking them to review and fix whats needed.
If you want to enforce the use of pull request and to block the ability to a direct push so don't add them as collaborators and tell them to fork the project. Now when they want to push their code it will done using pull request.
Upvotes: 2
Reputation: 225
There are many ways to do this, perhaps the easiest way would be implementing the following work flow: Collaborators fork your repo, they make there changes and push them to the master on their fork. Then they can issue a pull request. Then you review their code in the pull request and if satisfied you merge the pull request with your master.
Upvotes: 3