Skip to main content
Version: 0.1.0

Working with Branches

Branches let you work on changes in isolation before merging to main.

Create a Branch

curl -X POST \
http://localhost:8080/api/management/repositories/default/myapp/branches \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "feature-xyz",
"from_branch": "main",
"description": "Feature XYZ development"
}'

List Branches

curl http://localhost:8080/api/management/repositories/default/myapp/branches \
-H "Authorization: Bearer TOKEN"

Switch Branch

JavaScript Client

const featureWs = db.workspace('content').onBranch('feature-xyz');

await featureWs.nodes().create({
type: 'Article',
path: '/articles/new-feature',
properties: { title: 'New Feature' }
});

Via API Path

# Create node on feature branch
curl -X POST \
http://localhost:8080/api/repository/myapp/feature-xyz/head/content/articles/test \
-H "Authorization: Bearer TOKEN" \
-d '{"node_type": "Article", "properties": {"title": "Test"}}'

Delete a Branch

curl -X DELETE \
http://localhost:8080/api/management/repositories/default/myapp/branches/feature-xyz \
-H "Authorization: Bearer TOKEN"

Next Steps