1

I need to interact programmatically with a BitBucket Server to create and manage repositories.

To create a repository, a corresponding REST API method is available.

The created repositories should have LFS enabled. In the Web-UI, there is a simple checkbox to do this. But I was not able to find anything in the REST API to enable LFS programmatically.

Does anybody know of any API to enable LFS in a BitBucket repository?

I tried some variants in the API urls to see if there are undocumented methods (e.g. ...{repo-slug}/settings, but wasn't successful (receiving http status code 405).

1 Answer 1

3

A colleague has found a non-official solution to the problem in an Atlassian JIRA thread

There it is reported that:

There's actually an undocumented endpoint for interacting with LFS. It's rough and clearly not polished, but it works.

rest/git-lfs/admin/projects/<key>/repos/<slug>/enabled

GET will return a 200 if it's enabled, 404 if it's disabled.
PUT to enable
DELETE to disable

So let's hope this undocumented feature remains available for those that need this functionality... use it at your own risk.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.