Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Stash REST API - Control fork syncing feature

Andrew Milne October 8, 2013

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

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 9, 2013

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

Andrew Milne October 9, 2013

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.

coolnicks-nikhil February 17, 2015

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}

Stephen Waring November 16, 2015

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

Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 17, 2015
0 votes
Andrew Milne October 9, 2013

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.

TAGS
AUG Leaders

Atlassian Community Events