Create a pull request
- Fork a teammate's repository
- Copy your fork and make a change to the repository
- Create a pull request
To aww and inspire your teammate's with words of wisdom, you can request your change to get added to the original repository. To do that, you create a pull request.
Step 1. Compare your fork to the original
While you were working on adding your quote, another teammate might have made updates to the original repository. At this point, you can check that and decide if you need to adjust your fork accordingly. Do the following to compare your changes with the repository:
- Log into Bitbucket and navigate to your
myteamquotesrepository. Forked repositories have a special widget that lets you compare your fork work to the original.
- Click the Compare link on the left side of the page. The Compare section has a specialized view that is available only in forked repositories.
- Press the Compare button to compare your forked repository to the original repository.
- If someone has made changes to the original repository since you forked it, you will see that your forked repository is one or more commits behind the original. If that is the case, to update your repository, click Sync now and then Sync on the popup that appears.
If you want to see the differences between your current repository and the original repository, click the Diff tab to compare changes. If there are multiple commits, you see their cumulative changes by file in this section. Click the Side-by-side diff button to see changes displayed side-by-side. Or press the View file button to view the full file in Bitbucket.
- Switch back to the Commits tab to see the list of commits pushed from your local repository to the fork in Bitbucket. To see the contents of a specific commit in isolation, click a Commit link and Bitbucket takes you to the Commits page.
Step 2. Create a pull request
Now it's time to request that your quote get added to the original repository for all to see! From your
myteamquotes repository in Bitbucket, do the following:
- Press Create Pull Request.
The system displays the request form.
- Complete the form. For your purposes today, you only have to add a Title.
When you are done it will look something like this:
- Press Create pull request.
The system opens your latest request on the Pull Request page of the original repository in the tutorials account. To see the list of all the pull requests against this repo, click the Pull Request tab.
After you create a pull request, you can't delete it. If you delete your fork after you make a request, the receiver can only decline your request because the repository to pull from is gone.
Step 3. Learn what happens to your pull request
You have to wait for the repository owner to accept your pull request. When the original repository owner logs into Bitbucket, that user's newsfeed shows your pull request and your fork from a few days earlier, as shown in the following image.
When the repo owner clicks on your pull request, that user can Merge, Edit, or Decline it. In addition to owners, anyone with access to the repository can Approve the request, which means that person reviewed the changes in the pull request.
You've contributed to a repository!
You'll get an email when your pull request is accepted or rejected. If you want to try out other things in Bitbucket while you wait, check out how to enable an issue tracker, set up a wiki, or add user permissions.
Was this helpful?
Thanks for your feedback!