Collaborating: review online
The GitHub flow allows us to propose and review changes in pull requests. To do so, you need to add collaborators who are granted push access to a shared repository. They create topic branches when changes need to be made. Pull requests initiate code review and general discussion about the changes before they are merged into the main branch.
How to share file with the reviewer?
- Go to this website and log in.
- Open your repository.
- Click Settings on the right.
- Go to Branches on the left navigation panel.
- Click Add rule in branch protection rules.
- Provide a name of the branch and check Require pull request reviews before merging checkbox.
- Click Create.
- Go to Manage access on the left navigation panel.
- Provide your password and click Confirm password.
- Click Invite a collaborator.
- Search for collaborator in the search bar.
- Click Add (user name) to this repository.
How to review the shared file?
- Open the email you received inviting you to collaborate.
- Accept the invitation and click on the highlighted link to open the repository in GitHub Pages.
- In this repository, click Code to clone the repository and Open with GitHub Desktop.
- Open GitHub Desktop.
- Click Branch on the navigation bar, and add New Branch.
- Provide the name of the branch and click Create branch.
- In GitHub Desktop, select Open in Visual Studio Code.
- Apply the changes in the file in Visual Studio Code.
- Save the applied changes.
- Go to GitHub Desktop.
- Open Changes tab and verify if the file contains the applied changes.
- Write a summary in the Summary field about the change you made to the file.
- Click Commit to [branch name].
- Click Push origin.
- Click Create pull request.
- You are now moved to github.com page.
- In Open a pull request window, Use the base branch dropdown menu to select the branch you want to merge your changes into, then use the compare branch drop-down menu to choose the branch you made your changes in.
- Provide a description for your pull request.
- Click on the gear icon on the right in Reviewers section and assign a person who will review the applied changes.
- Click Create pull request.
How to review the changes made by reviewer?
- Open the pull request either by clicking the link on your email or:
- Go to the repository.
- Open Pull requests tab.
- Open the file.
- Go to Files changed tab and review the applied changes.
- Click Review changes on the right. You have three options:
- Select Comment to leave general feedback without approving the changes or requesting additional changes.
- Select Approve to submit your feedback and approve merging the changes.
- Select Request changes to submit feedback that must be addressed before the pull request can be merged.
- If the changes are approved, select Merge pull request.
- Select Confirm merge.
- After merging request is done and the changed content is added to your file in the repository, you can delete branch created during the process.