Is there any way in the REST API to turn on and off fork syncing?
I'm writing a REST script to fork a bunch of repositories and I'd like to have them setup to use syncing. Unfortunatlly rest/api/1.0/projects/{projectKey}/repos/{repositorySlug} creates the new repository with this feature disabled and I can't see a way to turn it on at fork time or after the fact.
Anoyingly fork syncing is enabled by default when creating a new fork in the UI, but not when done by REST API.
Thanks
Community moderators have prevented the ability to post new answers.
Hi Andrew,
That REST endpoint is part of Stash's public API and will not be deleted in upcoming releases. You're safe to use it. I see that we have not added ref-sync to our documentation (https://developer.atlassian.com/stash/docs/2.7.2/reference/rest-api.html) yet. I'll follow that up and add it.
Cheers,
Michael
That's good to know, thanks for the fast repsonse.
I had to uncheck "Show only public APIs" in the API browser to see it so I was a bit worried. I only found out about it by watching the http requests from my browser when I clicked on the fork syncing check button in the UI, if your updating the docs it should also probablly be flagged public at the same time.
Thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, I tried but it didn't work for me. curl -X POST -H "Content-Type: application/json" -u {username}:{password} http://{My-compnay-url}.net/git/rest/sync/1.0/projects/{projectKey}/repos/{repositorySlug}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael I am interested in a solution for this. I see from your comments that you were going to add ref-sync to the documentation. I have had a search but have not been able to find it. Are you able to confirm the link to where this is documented? Stephen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can find it here: https://developer.atlassian.com/static/rest/bitbucket-server/4.1.0/bitbucket-repository-ref-sync-rest.html (for the latest version)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm, I found:
rest/sync/1.0/projects/{projectKey}/repos/{repositorySlug}
In the API browser which is exactly what I wan't to do. Does anyone know if this API will eventually become public? I'd really like to make use of it but don't want to tie myself to something that will end up deleted in the next release.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.