LogoLogo
DoltHubBlogDiscordGitHubDolt
  • Introduction
    • What Is Dolt?
    • Installation
      • Linux
      • Windows
      • Mac
      • Build from Source
      • Application Server
      • Docker
      • Upgrading
    • Getting Started
      • Version Controlled Database
      • Git For Data
      • Versioned MySQL Replica
    • Use Cases
      • Data Sharing
      • Data and Model Quality Control
      • Manual Data Curation
      • Version Control for your Application
      • Versioned MySQL Replica
      • Audit
      • Configuration Management
      • Offline First
  • Concepts
    • Dolt
      • Git
        • Commits
        • Log
        • Diff
        • Branch
        • Merge
        • Conflicts
        • Remotes
        • Working Set
      • SQL
        • Databases
        • Schema
        • Tables
        • Primary Keys
        • Types
        • Indexes
        • Views
        • Constraints
        • Triggers
        • Procedures
        • Users/Grants
        • Transactions
        • System Variables
      • RDBMS
        • Server
        • Backups
        • Replication
    • DoltHub/DoltLab
      • Permissions
      • Pull Requests
      • Issues
      • Forks
  • SQL Reference
    • Running the Server
      • Configuration
      • Access Management
      • Branch Permissions
      • Backups
      • Garbage Collection
      • Metrics
      • Replication
      • Troubleshooting
    • Version Control Features
      • Using Branches
      • Merges
      • Querying History
      • Using Remotes
      • Procedures
      • Functions
      • System Tables
      • System Variables
      • Saved Queries
    • SQL Language Support
      • Data Description
      • Expressions, Functions, Operators
      • Supported Statements
      • MySQL Information Schema
      • Collations and Character Sets
      • System Variables
      • Miscellaneous
    • Supported Clients
      • Programmatic
      • SQL Editors
    • Benchmarks and Metrics
      • Correctness
      • Latency
      • Import
  • CLI Reference
    • Commands
    • Git Comparison
  • Architecture
    • Overview
    • Storage Engine
      • Commit Graph
      • Prolly Trees
      • Block Store
    • SQL
      • Go MySQL Server
      • Vitess
  • Guides
    • Cheat Sheet
    • Contributing
      • dolt
      • go-mysql-server
    • MySQL to Dolt Replication
    • Importing Data
    • Integrations
  • Other
    • FAQ
    • Roadmap
    • Versioning
  • Products
    • Hosted Dolt
      • Getting Started
      • Notable Features
      • SQL Workbench
      • Cloning a Hosted Database
      • Using DoltHub as a Remote
      • Infrastructure
      • Private Networking
    • DoltHub
      • Data Sharing
      • API
        • Authentication
        • SQL
        • CSV
        • Database
        • Hooks
      • Continuous Integration
        • Getting Started
        • Workflow Reference
      • Transform File Uploads
      • Workspaces
    • DoltLab
    • Dolt Workbench
    • DoltgreSQL
Powered by GitBook
On this page
  • What is a remote?
  • How to use remotes
  • Difference between Git remotes and Dolt remotes
  • Example

Was this helpful?

Edit on GitHub
Export as PDF
  1. Concepts
  2. Dolt
  3. Git

Remotes

PreviousConflictsNextWorking Set

Last updated 1 year ago

Was this helpful?

What is a remote?

A remote is a Dolt database in another location, usually on a different, network accessible host. A Dolt remote is the coordination mechanism between many local copies of Dolt. A Dolt database can have multiple remotes.

DoltHub is a hosted Dolt remote with an additional discovery and management user interface. is a self-hosted version of DoltHub. .

You configure a storage location as a remote. Once configured, you can perform Dolt's distributed operations using that remote: clone, fetch, push, and pull.

Clone creates a copy of remote database in your current directory. In the case of clone, the remote you cloned from is automatically configured as the origin remote.

Fetch gathers all the changes made to the remote since you last fetched.

Push performs a merge of your current branch and the remote branch you are pushing to. It sends all the associated changed data and schema to the remote and updates the commit log to reflect the push.

Pull performs a fetch then a merge of the remote branch to your local branch. Essentially pull merges the changes on the remote branch into your local branch.

How to use remotes

A remote is the basis for all the distributed collaboration features of Dolt.

If you would like to make sure your local database can survive a destructive local operation, you create a remote on another machine and push your local Dolt database to it.

If you would like a Dolt database to be used by more than one person, you create and configure a remote and then push your local Dolt database to that remote. That person then can clone or pull the remote.

Difference between Git remotes and Dolt remotes

Dolt and Git remotes are conceptually the same. Practically, in Git you can set your own local Git directory up as a remote. In Dolt, this is not supported. You must configure a dedicated location for your Dolt remote.

Example

dolt $ dolt clone timsehn/docs
cloning https://doltremoteapi.dolthub.com/timsehn/docs
29 of 29 chunks complete. 0 chunks being downloaded currently.
dolt $ cd docs/
docs $ dolt ls
Tables in working set:
	 docs

docs $ dolt sql -q "select * from docs"
+----+----+
| pk | c1 |
+----+----+
+----+----+
docs $ dolt sql -q "insert into docs values (0,0),(1,1),(2,2)"
Query OK, 3 rows affected
docs $ dolt sql -q "select * from docs"
+----+----+
| pk | c1 |
+----+----+
| 0  | 0  |
| 1  | 1  |
| 2  | 2  |
+----+----+
docs $ dolt add docs
docs $ dolt commit -m "Committing inserts so I can push it to my remote"
commit uhumidn2e7ucan59jk9vuabm7r5osggs
Author: Tim Sehn <tim@dolthub.com>
Date:   Mon Dec 06 17:14:46 -0800 2021

	Committing inserts so I can push it to my remote

docs $ dolt remote
origin
docs $ dolt remote -v
origin https://doltremoteapi.dolthub.com/timsehn/docs 
docs $ dolt push origin main
\ Tree Level: 1, Percent Buffered: 0.00% Files Written: 0, Files Uploaded: 1
DoltLab
Dolt also supports filesystem, HTTPS, AWS, and GCS remotes