Q1. Bitbucket has a syncing feature for fork. When I sync, does that mean my repo is being sync'ed and merged together with the upstream repo that I forked from with each branch according to their names? So this effectively is a git fetch and merge for each branch with their matching branch names if I had my fork on my local and decided to sync.
Q2. The upstream repo has a master and a develop branch. The develop branch pulls in the requests and merge them and is compared to the master branch and merges into master. This merge commit created in master branch should not be present in the develop branch right? Say develop branch handles all the pull requests which are also created from develop branch, not merged from master. Everyone's develop branch should be clean of the 'master-merges-develop' commits?
Regarding Q1, the documentation is clear:
What gets synced?
When performing automatic synchronization, Bitbucket Server updates the fork as follows:
- for branches - Bitbucket Server makes any fast-forward change, where there is no need to merge work and there is no risk of losing changes.
- for tags - Bitbucket Server 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 Server will not perform a merge automatically. When you visit the branch in Bitbucket Server, 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:
For Q2, if the merges are done always from develop to master, the merge commits in master won't ever be in develop indeed.