Reputation: 1917
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
Upvotes: 55
Views: 33826
Reputation: 592
Here comes the easiest way...
It should update the Last automatic synchronization timestamp.
Upvotes: 7
Reputation: 33
In Bitbucket, using the "Enable Fork Syncing" feature for your forked repo makes it super easy to pull new changes from the original repo into the forked repo.
e.g.
(master) $ git checkout -b feature
# below git command will fetch all the changes from the original repo's master branch
# into your local's master branch because we had enabled fork syncing.
(feature) $ git fetch origin master:master
# use merge or rebase as per your preference
(feature) $ git rebase master
Documentation @ https://confluence.atlassian.com/bitbucketserver/keeping-forks-synchronized-776639961.html
Upvotes: 0
Reputation: 21
On Repository settings -> Fork Syncing Uncheck & check option "Enable fork syncing"
You will see a message Last automatic synchronization: a moment ago
Upvotes: 1
Reputation: 71
On the left hand side, the repository details panels shows a SYNC button IF AND ONLY IF there is any commit behind
Upvotes: 3
Reputation: 2153
In the latest version there is a Repository-Details box on the right side with a sync button if the root has unmerged updates.
Upvotes: 2
Reputation: 211
https://bitbucket.org/<user name>/<fork name>/branches/compare
Upvotes: 19
Reputation: 73748
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.
Upvotes: 69