Skip to main content
Documentation

Global Configuration

Global configuration applies to all repositories for the current user and is stored in ~/.ditsconfig.

Configuration File Location

# Global config (applies to all your repos)
~/.ditsconfig

# On Windows
C:\Users\<username>\.ditsconfig

Essential Setup

Before using Dits, configure your identity for commits:

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

User Settings

OptionDescriptionExample
user.nameYour name for commits"Jane Editor"
user.emailYour email for commits"jane@example.com"
user.signingkeyGPG key for signing commits"ABC123DEF"

Core Settings

OptionDescriptionExample
core.editorDefault text editor"code --wait"
core.pagerPager for long output"less -R"
core.excludesFileGlobal ignore patterns file"~/.ditsignore"

Setting Your Editor

# VS Code
$ dits config --global core.editor "code --wait"

# Sublime Text
$ dits config --global core.editor "subl -n -w"

# Vim
$ dits config --global core.editor "vim"

# Nano
$ dits config --global core.editor "nano"

Global Ignore Patterns

Create a global ignore file for patterns that apply to all repositories:

# Set the global excludes file
$ dits config --global core.excludesFile ~/.ditsignore

# Create the file
$ cat > ~/.ditsignore << 'EOF'
# OS files
.DS_Store
Thumbs.db
desktop.ini

# Editor files
*.swp
*~
.idea/
.vscode/

# Build artifacts
*.log
*.tmp
EOF

Aliases

Create shortcuts for frequently used commands:

# Common aliases
$ 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 use them
$ dits co main
$ dits st
$ dits ci -m "Quick commit"

# More complex aliases
$ dits config --global alias.lg "log --graph --oneline --all"
$ dits config --global alias.last "log -1 HEAD"
$ dits config --global alias.unstage "restore --staged"

$ dits lg  # Shows nice graph
$ dits last  # Shows last commit

Credential Storage

Configure how Dits stores your credentials:

# Store credentials in memory for 15 minutes
$ dits config --global credential.helper cache

# Store credentials longer
$ dits config --global credential.helper "cache --timeout=3600"

# Store credentials on disk (less secure)
$ dits config --global credential.helper store

# Use macOS Keychain
$ dits config --global credential.helper osxkeychain

# Use Windows Credential Manager
$ dits config --global credential.helper manager

Transfer Settings

Configure network transfer behavior:

# Limit upload bandwidth
$ dits config --global transfer.uploadLimit 50M

# Limit download bandwidth
$ dits config --global transfer.downloadLimit 100M

# Number of parallel transfers
$ dits config --global transfer.parallel 4

# Connection timeout (seconds)
$ dits config --global transfer.timeout 30

Default Behaviors

Set default behaviors for common operations:

# Rebase on pull instead of merge
$ dits config --global pull.rebase true

# Push current branch by default
$ dits config --global push.default current

# Auto-setup remote tracking
$ dits config --global push.autoSetupRemote true

# Enable colors
$ dits config --global color.ui auto

# Set default branch name
$ dits config --global init.defaultBranch main

View Global Configuration

# List all global settings
$ dits config --global --list
user.name=Jane Editor
user.email=jane@example.com
core.editor=code --wait
alias.co=checkout
alias.st=status
...

# Show specific value
$ dits config --global user.name
Jane Editor

# Show where a value is set
$ dits config --show-origin user.name
file:~/.ditsconfig    user.name=Jane Editor

Edit Global Configuration

# Open in editor
$ dits config --global --edit

# Unset a value
$ dits config --global --unset alias.old

Example Global Configuration

# ~/.ditsconfig
[user]
    name = Jane Editor
    email = jane@example.com

[core]
    editor = code --wait
    pager = less -R
    excludesFile = ~/.ditsignore

[alias]
    co = checkout
    br = branch
    ci = commit
    st = status
    lg = log --graph --oneline --all
    last = log -1 HEAD

[credential]
    helper = osxkeychain

[pull]
    rebase = true

[push]
    default = current
    autoSetupRemote = true

[init]
    defaultBranch = main

[color]
    ui = auto

[transfer]
    parallel = 4

Related Topics