[Other doc versions]
[Doc downloads]
Fork syncing helps you to keep your fork in Stash up-to-date with changes in the upstream repository. Stash 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, Stash will offer syncing strategies. Stash 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:
You can enable automatic fork syncing when you first fork the repository:
You can also enable fork syncing at any later time by going to Settings > Fork syncing for the forked repository. Syncing is disabled by default.
When performing automatic synchronization, Stash updates the fork as follows:
Manual syncing
If upstream and your fork have diverged, so that each has changes that are not in the other, Stash will not perform a merge automatically. When you visit the branch within Stash, you have the option to manually synchronize the branch
You can manually synchronize your branch at any time using Synchronize on either of the 'Files' or 'Commits' tabs for a repository:
When you initiate a manual synchronization, Stash ask you to choose one of the following synchronization strategies.
Merge the upstream branch into the fork branch.
If Stash 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.
Overwrite your changes in your fork with the upstream branch. Your changes will be lost.