Skip to main content
Documentation

Configuration

Dits uses a layered configuration system similar to Git. Settings can be configured at the system, global, or repository level.

Configuration Levels

  • System (/etc/ditsconfig): Applies to all users on the system
  • Global (~/.ditsconfig): Applies to all your repositories
  • Repository (.dits/config): Applies only to the current repository

More specific configurations override less specific ones (repository overrides global, global overrides system).

Basic Usage

Get a Value

$ dits config user.name
John Editor

Set a Value

# Set in current repository
$ dits config user.name "John Editor"

# Set globally (for all repositories)
$ dits config --global user.name "John Editor"

# Set at system level (requires admin)
$ dits config --system user.name "John Editor"

List All Configuration

$ dits config --list
user.name=John Editor
user.email=john@example.com
cache.size=10GB
...

Unset a Value

$ dits config --unset user.name

Edit Configuration File

$ dits config --global --edit

Configuration Options

KeyDescriptionDefaultExample
user.nameYour name for commits(none)"John Editor"
user.emailYour email for commits(none)"john@example.com"
core.editorEditor for commit messages$EDITOR or vim"code --wait"
core.pagerPager for long outputless"less -R"
push.defaultDefault push behaviorsimple"current"
pull.rebaseRebase on pullfalsetrue
cache.sizeLocal cache size limit10GB"50GB"
gc.gracePeriodTime before orphaned objects are collected2 weeks"30 days"
mount.defaultPathDefault mount point for VFS/Volumes/dits-<repo>"/mnt/dits"

Essential Configuration

Before making commits, you should set your identity:

$ dits config --global user.name "Your Name"
$ dits config --global user.email "you@example.com"

Configuration File Format

Configuration files use a simple INI-like format:

[user]
    name = John Editor
    email = john@example.com

[core]
    editor = code --wait
    pager = less -R

[cache]
    size = 50GB

[remote "origin"]
    url = https://dits.example.com/team/project

Remote Configuration

Remotes are configured under [remote "name"] sections:

# Add a remote
$ dits remote add origin https://dits.example.com/team/project

# This adds to config:
[remote "origin"]
    url = https://dits.example.com/team/project
    fetch = +refs/heads/*:refs/remotes/origin/*

Aliases

Create shortcuts for common commands:

$ dits config --global alias.co checkout
$ dits config --global alias.br branch
$ dits config --global alias.ci commit
$ dits config --global alias.st status

# Now you can use:
$ dits co main
$ dits st

Environment Variables

Configuration can also be set via environment variables:

VariableDescription
DITS_DIROverride .dits directory location
DITS_WORK_TREEOverride working tree location
DITS_CACHE_DIROverride cache directory
DITS_CONFIG_GLOBALOverride global config path
DITS_EDITOROverride editor
DITS_PAGEROverride pager

Next Steps