Bitbucket: Update a fork to merge changes of master repo?

23,721

Solution 1

Just like GitHub, you have to pull the commits down to your own machine, merge, and then push them back to your fork on Bitbucket.

If you go to your fork on Bitbucket you can click "compare fork" to get to a page where you see incoming and outgoing commits. If you go to the "incoming" tab, you will see instructions like

$ git remote add <remote_name> [email protected]:<upstream>/<repo>.git
$ git fetch <remote_name>
$ git checkout master
$ git merge <remote_name>/master

which correspond closely to the GitHub instructions.

Solution 2

  1. Goto your fork on bitbucket
  2. Click the Branches menu from the left navigation pane
  3. Click on the "..." button to the right of the branch and select "Compare". Or, in the url add the word “compare”. So that the URL looks like this: https://bitbucket.org/<user name>/<fork name>/branches/compare
  4. Click on the switch icon (black up/down arrows between the branch segments) so that the blue arrow is pointing into your fork
  5. Select the correct branches in your fork and the owner's repo
  6. Click Compare
  7. Click Merge

Solution 3

Ahhhhhh here comes the easiest way....
1. Go to your fork repo.
2. Select Repository Settings tab.
3. Select Fork Syncing tab.
4. Deselect automatic sync.
5. Re-select automatic sync.

Life just got easy with this hack.

Solution 4

On the left hand side, the repository details panels shows a SYNC button IF AND ONLY IF there is any commit behind

enter image description here

Solution 5

In the latest version there is a Repository-Details box on the right side with a sync button if the root has unmerged updates.

Share:
23,721
franka
Author by

franka

Updated on July 02, 2020

Comments

  • franka
    franka almost 4 years

    I am working with a bitbucket git repo I have read-only access to, so I created a fork to work on my features.

    Question: How do I update my fork to include changes made to the original repo made by the owner?

    On github, it seems one has to do the following, so I suspect it's a similar to this:

     $ git remote add upstream git://github.com/octocat/Spoon-Knife.git
     $ git fetch upstream
     $ git merge upstream/master
    

    I couldn't find any information on this in the Bitbucket Documentation for forking