Keeping forks synchronized

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

Fork syncing helps you to keep your fork in Bitbucket Data Center and Server up-to-date with changes in the upstream repository. Bitbucket can do this automatically for all branches and tags you haven't modified in the fork.

If you have modified branches or tags in the fork, Bitbucket will offer syncing strategies. Bitbucket will never update your branch or tag in your fork if this means that your changes would be lost.

Note that syncing is about pulling recent upstream changes into your fork, whereas pull requests are about pushing your changes back to the upstream repository.

On this page:

Enabling automatic fork syncing

You can enable automatic fork syncing when you first fork the repository:

  1. Enable fork syncing

Syncing is enabled by default. You can disable or enable fork syncing at any time later by going to Repository Settings > Workflow > Fork syncing for the forked repository. 

What gets synced?

When performing automatic synchronization, Bitbucket updates the fork as follows:

  • for branches - Bitbucket makes any fast-forward change, where there is no need to merge work and there is no risk of losing changes.
  • for tags - Bitbucket makes updates only if the current state is the same as what upstream pointed to. So, a new tag in upstream will create a new tag in the fork, unless you have a tag of the same name, when the update will fail.

Manual syncing

If upstream and your fork have diverged, so that each has changes that are not in the other, Bitbucket will not perform a merge automatically. When you visit the branch, you have the option to manually synchronize the branch.

You can manually synchronize your branch at any time using Synchronize by going to the Settings > Fork syncing tab for the forked repository, or on either of the Source or Commits tabs for a repository:

Manual synchronization strategies

When you initiate a manual synchronization, Bitbucket will ask you to choose one of the following synchronization strategies.

Merge strategy

Merge the upstream branch into the fork branch.


If Bitbucket detects conflicts when trying to perform the merge it will offer hints on how to resolve those:

Once the merge is complete, your branch will have incorporated all the commits on the branch in the parent repository, but your branch will still be ahead of the parent (it has your changes on it). This means automatic synchronization for this branch will not occur until your changes are pushed to the parent repository.

Rebase strategy

Rebase the fork branch onto the upstream branch. Creates a new non-merge commit for each commit on the fork.

Discard strategy

Overwrite your changes in your fork with the upstream branch. Your changes will be lost.

最終更新日: 2023 年 2 月 26 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.