1. Home
  2. Docs
  3. SQL Server
  4. Command Line Interface

Command Line Interface

This feature is only available to licenced users

A sample project is available on GitHub at https://github.com/gitsql/cli-gitsql-sqlserver


gitSQL import/export -s <ServerName> -i <InstanceName> -a <WindowsAuth> [-u <Username>] [-p <Password>] -d <Directory> [-o <OptionsFile>] 

Argument list example:
         -s  :  localhost
         -d  :  "c:\temp\folder"
         [-a]:  false
         [-i]:  SQLEXPRESS
         [-u]:  sa
         [-p]:  sapassword
         [-o]:  "c:\temp\options.json"

Usage Example


gitsql export -s DESKTOP -i SQLEXPRESS -o opts.json -d "c:\source_control"


An options file is required if more than one database is located in the export directory.


gitsql import -s DESKTOP -i SQLEXPRESS -d "c:\source_control"

Options File

        "includeDrop": "false",
        "includeDependencies": "false",
        "includeIndexes" : "false",
        "includeConstraints": "false",
        "includeTriggers": "false",
                "findMe": "SET QUOTED_IDENTIFIER ON",
                "replaceWith": ""
        "db": "AdventureWorks2012",
        "exportMode": "schema"

exportMode = schema/data – for schema only or data only.

How can we help?