Skip to main content

Pull Request

A pull request (often shortened to PR) is a mechanism for submitting changes to the source code of a software project. It allows developers to submit changes to the repository of another project, intending to review and possibly integrate those changes into the original project's codebase.

Pull requests let you tell others about changes you've pushed to a branch in a repository on Gitopia. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.

Pull Requests has its own section in every repository on Gitopia.


Creating a Pull Request#

  • Navigate to the main page of your repository.

  • Next, navigate to the Pull Requests section of the repository and click on New Pull Request to create a pull request.

  • Now, select the source branch(the branch you made changes in) and the target branch(the branch you'd like to merge your changes into) from their respective drop-down menus.

note

Once you have selected the source and target branches, you can compare your changes from the diff display.

You have two options for viewing a diff:

  • The unified view shows updated and existing content together in a linear view.
  • The split view shows old content on one side and new content on the other side.

  • Click on Create Pull Request.

  • Type a title and description for your pull request. Optionally, you can assign Reviewers or apply a Label.

  • When you are finished, to create a pull request that is ready for review, click Create Pull Request.

  • After your pull request has been reviewed, it can be merged into the repository.

Creating a Pull Request from a fork#

  • Navigate to the repository where you created your fork.

  • Next, navigate to the Pull Requests section of the repository and click on New Pull Request to create a pull request.

  • Now, select the source branch(the branch that you made changes in) and the target branch(the branch of the upstream repository you'd like to merge changes into) from their respective drop-down menus.

  • Click on Create Pull Request.

  • Type a title and description for your pull request. Optionally, you can assign Reviewers or apply a Label.

  • When you are finished, to create a pull request that is ready for review, click Create Pull Request.

  • After your pull request has been reviewed, it can be merged into the repository.


Merging a Pull Request#

  • Navigate to the main page of your repository and click on Pull Requests.

  • In the "Pull Requests" list, click the pull request you'd like to merge.

  • Click on Mege Pull Request.

  • You will first be prompted to give forking access to the Gitopia data server. Click on Grant Access.

note

This prompt will show up only once every user. This authorization is required to keep the state of gitopia blockchain and git server consistent. Only after successful fork or merge, git server broadcasts the relevant transaction on behalf of the user. This authorization is restricted to fork and merge PR transactions.

  • Your Pull Request has been merged.

  • Navigate to the Code section of the repository to see the results.