curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/sync-git" \
-H "Authorization: Bearer runtm_xxx"
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/sync-git",
headers={"Authorization": "Bearer runtm_xxx"},
)
data = response.json()
print(f"Synced: {data['synced']} (ahead: {data['ahead']}, behind: {data['behind']})")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/sync-git",
{
method: "POST",
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const data = await response.json();
console.log(`Synced: ${data.synced} (ahead: ${data.ahead}, behind: ${data.behind})`);
{
"session_id": "ses_abc123",
"synced": true,
"ahead": 0,
"behind": 0
}
Git
Git Sync
Sync local changes with the remote repository
POST
/
api
/
sessions
/
{session_id}
/
sync-git
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/sync-git" \
-H "Authorization: Bearer runtm_xxx"
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/sync-git",
headers={"Authorization": "Bearer runtm_xxx"},
)
data = response.json()
print(f"Synced: {data['synced']} (ahead: {data['ahead']}, behind: {data['behind']})")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/sync-git",
{
method: "POST",
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const data = await response.json();
console.log(`Synced: ${data.synced} (ahead: ${data.ahead}, behind: ${data.behind})`);
{
"session_id": "ses_abc123",
"synced": true,
"ahead": 0,
"behind": 0
}
Synchronizes the sandbox’s local git changes with the remote repository. Performs a fetch, rebase, and push to ensure the local and remote branches are in sync.
Required scope:
sessions:write
Path Parameters
string
required
The session ID (e.g.
ses_abc123).Headers
string
required
Bearer token. Example:
Bearer runtm_xxxResponse
string
Session ID.
boolean
Whether the sync completed successfully.
integer
Number of commits ahead of remote after sync.
integer
Number of commits behind remote after sync.
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/sync-git" \
-H "Authorization: Bearer runtm_xxx"
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/sync-git",
headers={"Authorization": "Bearer runtm_xxx"},
)
data = response.json()
print(f"Synced: {data['synced']} (ahead: {data['ahead']}, behind: {data['behind']})")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/sync-git",
{
method: "POST",
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const data = await response.json();
console.log(`Synced: ${data.synced} (ahead: ${data.ahead}, behind: ${data.behind})`);
{
"session_id": "ses_abc123",
"synced": true,
"ahead": 0,
"behind": 0
}