Pull Updates from Remote

Open inAnthropic

Prerequisites

What you'll achieve By the end of this guide, you will have pulled new commits from a remote branch into your local clone — like git pull for databases.

After cloning a database, the remote may receive new commits. Pull fetches those changes and merges them into your local branch.

Pull from a remote branch

Pull the enriched branch from the Star Wars public data server. This branch adds a Starship class and starship data:

Example: TypeScript
const pullEnrichedBranch = async () => {
  client.remoteAuth({ type: "basic", user: "public", key: "public" })

  const result = await client.pull({
    remote: "origin",
    remote_branch: "enriched",
    message: "Pull enriched branch with starship data",
  })
  console.log("Pull result:", result)
}

After pulling, your local main branch now includes the Starship schema and data from the remote enriched branch.

Inspect what changed

After pulling, inspect the new data that arrived:

Example: TypeScript
const inspectChanges = async () => {
  // Get recent commits to see what was pulled
  const log = await client.getCommitHistory()
  console.log("Recent commits:", log.slice(0, 3))

  // Get all documents to see new starship data
  const docs = await client.getDocument({ as_list: "true", type: "Starship" })
  console.log("Starships:", docs)
}

Next steps

  • Push changes — send your local modifications to a remote
  • Time travel — inspect the state before the pull
  • Reset — undo the pull by resetting to a previous commit

Was this helpful?