Creating pull requests for code reviews in Git

Objective :

This page explains about how to fork a repository and use pull request feature of Bitbucket.


  1. Login to Bitbucket and open your repository. Select Fork option visible at right top of the page.
  2. Give the details and fork it. Now you will see a repository in your repositories list.
  3. Give access to forked repository to  your all the users of the the repository at access management of Repository Settings.
  4. Goto Defaults reviewers and add the reviewers to the forked repository to be merged with original repository.
  5. Users can now the clone the repository and start using it.
  6. Once the clone is done can List the current configured remote repository for your fork using below command.
    git remote -v

    origin (fetch)
    origin (push)

  7. Now add the upstream using below repository
    git remote add upstream
  8. After adding the upstream repository
    "git remote -v" will show the below

    origin (fetch)
    origin (push)
    upstream (fetch)
    upstream (push)

  9. Now update the repository and push to forked repository.
  10. Fetch the Original Repository using
    git merge upstream/master
  11. Goto Bitbucket and Select pull request for merging the update to original repository.
  12. Reviewer/admins  reviews,approves and merges it.
  13. To fetch the updated files from Original repository use the below command
    git merge upstream/master


Leave a Reply

Your email address will not be published. Required fields are marked *