'Suggested Changes' On GitHub Allows Developers To Collaborate Within Pull Requests

GitHub has allowed users to comment within its pull requests. This time, it's going further by allowing users to write code snippets reflecting the desired change, right inside the pull request itself.

The feature is called 'Suggested Changes', and it aims to ease developers' work in implementing and doing action changes. And all of that can be made without requiring the developers in using any external tools, or needing to copy and paste.

GitHub formally introduced Suggested Changes at its Github Universe developer conference. Initially launched as a beta feature, it is available to users of GitHub’s Developer, Team, and Business Cloud plans.

According to its page:

"Collaborators can suggest code changes through inline comments in pull requests, and pull request authors can apply, reject, or edit these suggestions as an integrated part of the code review process."

Developers that want to suggest a change can do that directly in a pull request, if they have the write access to the repository, and also if they are the author or already assigned to the pull request.

To use the feature:

  • Click 'Pull Request' under the repository name.
  • In the list of Pull Requests, click the Pull Request that want to be changed.
  • Navigate to the suggested change.
  • Apply suggestion by clicking on the 'Apply Suggestion' button.
  • In the commit message field, type commit message that describes the changes made to the file.
  • Click 'Commit Changes'.

Developers using Suggested Change will create a commit on the compare branch of the pull request. The person who suggested the change will be the author of the commit, and the developer will be the committer of the commit.

GitHub apply suggestion on pull request

Suppose a developer is collaborating on a repository with an active pull request. Here, other developers can look at that pull request, and see if there any room for improvement. If there is, they can change the code by just leaving a comment.

And when reviewing a pull request, developers can choose to leave individual comments on specific changes. When they're finished reviewing the proposed changes, they can submit an overall review with a summary comment to approve the pull request or request additional changes.

After that, the author can accept or deny the suggestion using a single click.

"Collaboration is key to building better software, faster. Now your collaborators can suggest, edit, and accept changes inline with a single click - no more copy/pasting and moving between tools to accept suggestions," said GitHub, showing how convenience the feature is in aiding developers' work.

Published: 
17/10/2018