I'm not seeing the sync buttons on my forked repo
Asked by Brian_Walker:

I saw/used it once before. I think it should show under Repository Details in upper right block under 'Fork of...'. In the last hour, I merged changes into the main branch of the parent repository, but this button is not displaying.

![Screenshot 2023-07-03 141510.png](/t5/image/serverpage/image-id/266417i7B1CD17310819437/image-size/large?v=v2&px=999 "Screenshot 2023-07-03 141510.png")


Answers:
author: Brian_Walker
body: [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) I ran into this issue again today. The sync button did not appear on the Source page, so I tried focusing on the branch page and the Sync bar was displayed, but when I hovered over it I got a permission denied error. **This is because we enabled branch restrictions on the main branch that prevents direct writes to the main branch.** Once added an exception to the branch restriction I could sync from either the Source or the branch view.

I think branch restrictions on the main branch are a common convention. It might make sense to add an exception for this on the branch restrictions UI, specifically for forks that can sync from a parent repo. Alternatively, you could show a message on the Source page as to why sync is disabled.

Have a good weekend.


author: Brian_Walker
body: [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) Thank you for the response. I searched repeatedly on both the Source and the branch pages. As I mentioned, I have seen the Sync button on the Source page in the past, but this time I was not displaying (I checked over multiple hours and page reloads).

I have since manually merged those changes from the parent repo so I can't show you but the next time I will submit a bug with the actual repo. I'm pretty sure things were not working as designed.

Thanks again.


author: Patrik S
body: Hello [@Brian_Walker](/t5/user/viewprofilepage/user-id/4663150) and thank you for reaching out to Community!

If you pushed new commits to the parent repository main branch, when **accessing the fork repository** a **Sync** button should indeed be shown in the side card named *Repository details* , which is located on the top right side of the page when you navigate the *Source* page of the repository, as in the image below :

![Screenshot 2023-07-04 at 3.31.30 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/266602iD26FDF59F22607B7/image-size/large?v=v2&px=999 "Screenshot 2023-07-04 at 3.31.30 PM.png")

By clicking on that Sync button, the main branch of the fork repo should be synchronized with the corresponding branch in the parent repo.

Another alternative to accessing the **Sync** option is by navigating to the **Branches** page, selecting the main branch, and comparing it to the parent's main branch, as shown below:

![Screenshot 2023-07-04 at 3.33.04 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/266603i63E53AA2CD606D24/image-size/large?v=v2&px=999 "Screenshot 2023-07-04 at 3.33.04 PM.png")

In both places, the Sync option will have the same result of synchronizing the fork's main branch with the parent main branch.

It's important to note that:

* Only the **main** branch of the repository is synced with your fork. No other branch changes will be detected or available to sync.

* To sync branches that are not the main branch of the repository, you need to select the branch you want to sync as the main branch (*Repository Settings \>\> Repository details \>\> Expand ADVANCED \>\> Main branch* ) on both the parent and forked repository. Once you do this the **Sync**button should be shown in the locations mentioned above.

Thank you, [@Brian_Walker](/t5/user/viewprofilepage/user-id/4663150) !

Patrik S


Tags: bitbucket-cloud

cloud