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 EditorSet 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.nameEdit Configuration File
$ dits config --global --editConfiguration Options
| Key | Description | Default | Example |
|---|---|---|---|
| user.name | Your name for commits | (none) | "John Editor" |
| user.email | Your email for commits | (none) | "john@example.com" |
| core.editor | Editor for commit messages | $EDITOR or vim | "code --wait" |
| core.pager | Pager for long output | less | "less -R" |
| push.default | Default push behavior | simple | "current" |
| pull.rebase | Rebase on pull | false | true |
| cache.size | Local cache size limit | 10GB | "50GB" |
| gc.gracePeriod | Time before orphaned objects are collected | 2 weeks | "30 days" |
| mount.defaultPath | Default 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"Required for Commits
Dits requires user.name and user.email to be set before you can create commits. Set them globally to avoid setting them for each repository.
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/projectRemote 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 stEnvironment Variables
Configuration can also be set via environment variables:
| Variable | Description |
|---|---|
| DITS_DIR | Override .dits directory location |
| DITS_WORK_TREE | Override working tree location |
| DITS_CACHE_DIR | Override cache directory |
| DITS_CONFIG_GLOBAL | Override global config path |
| DITS_EDITOR | Override editor |
| DITS_PAGER | Override pager |
Next Steps
- Learn about CLI commands
- Set up remote repositories
- Configure VFS settings