Prerequisites
- TerminusDB running locally (install guide)
- A cloned database with local changes (clone guide)
- Write access to the remote database
What you'll achieve By the end of this guide, you will have pushed local commits to a remote TerminusDB server — like git push for databases.
After making changes to your local clone, push sends those commits to the remote so others can access them.
Push to a remote
Push your local main branch to the remote origin:
Example: TypeScript
const pushToRemote = async () => {
client.remoteAuth({ type: "token", key: "YOUR_API_TOKEN_HERE" })
const result = await client.push({
remote: "origin",
remote_branch: "main",
message: "Push local changes to remote",
})
console.log("Push result:", result)
}Example: Python
client.connect(user="admin", key="root", team="admin", db="my_local_copy")
result = client.push(
remote="origin",
remote_branch="main",
message="Push local changes to remote",
remote_auth={"type": "token", "key": "YOUR_API_TOKEN_HERE"},
)
print("Push result:", result)curl -u admin:root -X POST \
"http://localhost:6363/api/push/admin/my_local_copy/local/branch/main" \
-H "Content-Type: application/json" \
-H "Authorization-Remote: Token YOUR_API_TOKEN_HERE" \
-d '{
"remote": "origin",
"remote_branch": "main"
}'Push requires write access to the remote database. For public data servers (like data.terminusdb.org), you can only pull — not push. Push works with your own DFRNT Hub databases or self-hosted remotes where you have credentials.
Push a specific branch
Push a feature branch to a new remote branch:
Example: TypeScript
const pushFeatureBranch = async () => {
client.remoteAuth({ type: "token", key: "YOUR_API_TOKEN_HERE" })
client.checkout("feature")
const result = await client.push({
remote: "origin",
remote_branch: "feature",
message: "Push feature branch for review",
})
console.log("Feature branch pushed:", result)
}Example: Python
client.checkout("feature")
result = client.push(
remote="origin",
remote_branch="feature",
message="Push feature branch for review",
remote_auth={"type": "token", "key": "YOUR_API_TOKEN_HERE"},
)
print("Feature branch pushed:", result)curl -u admin:root -X POST \
"http://localhost:6363/api/push/admin/my_local_copy/local/branch/feature" \
-H "Content-Type: application/json" \
-H "Authorization-Remote: Token YOUR_API_TOKEN_HERE" \
-d '{
"remote": "origin",
"remote_branch": "feature"
}'Next steps
- Pull updates — fetch changes others have pushed
- Branch — create a feature branch before pushing
- Clone — start from a fresh clone of a remote database