Environment Variables¶
Configuration via environment variables.
Core Variables¶
GITY_HOME¶
Location of Gity's data directory.
| Default (Unix) | Default (Windows) |
|---|---|
~/.gity |
%APPDATA%\Gity |
Usage:
# Linux/macOS
export GITY_HOME=/custom/path/.gity
# Windows PowerShell
$env:GITY_HOME = "D:\gity-data"
# Windows CMD
set GITY_HOME=D:\gity-data
Directory structure:
$GITY_HOME/
├── config/ # Reserved for future settings
├── data/
│ ├── sled/ # Metadata database
│ └── status_cache/ # Cached status results
└── logs/
└── daemon.log # Daemon logs
GITY_DAEMON_ADDR¶
IPC socket address for daemon communication.
| Default |
|---|
tcp://127.0.0.1:7557 |
Usage:
# Change port
export GITY_DAEMON_ADDR=tcp://127.0.0.1:8888
# Use Unix socket (Linux/macOS only)
export GITY_DAEMON_ADDR=ipc:///tmp/gity.sock
Warning
Both daemon and CLI must use the same address.
Logging Variables¶
RUST_LOG¶
Control log verbosity (standard Rust logging).
| Value | Description |
|---|---|
error |
Only errors |
warn |
Warnings and errors |
info |
Informational messages (default) |
debug |
Debug information |
trace |
Detailed tracing |
Usage:
# More verbose logging
export RUST_LOG=debug
# Per-module logging
export RUST_LOG=gity=debug,sled=warn
GITY_LOG_FORMAT¶
Log output format.
| Value | Description |
|---|---|
pretty |
Human-readable (default for tty) |
json |
JSON format (default for non-tty) |
compact |
Compact single-line format |
Usage:
Git Variables¶
These standard Git variables affect Gity's behavior:
GIT_DIR¶
Override the Git directory location.
GIT_WORK_TREE¶
Override the working tree location.
System Variables¶
PATH¶
Ensure gity and git are accessible.
HOME (Unix) / USERPROFILE (Windows)¶
Used to determine default GITY_HOME location.
Platform-Specific Variables¶
Linux¶
XDG_DATA_HOME¶
If set, Gity may use this for data storage in future versions.
macOS¶
No additional variables.
Windows¶
APPDATA¶
Default location for GITY_HOME on Windows.
Typically: C:\Users\<username>\AppData\Roaming
Debug Variables¶
GITY_DEBUG¶
Enable debug mode with additional diagnostics.
GITY_TRACE¶
Enable detailed tracing for troubleshooting.
Example Configurations¶
Development Setup¶
# More verbose logging
export RUST_LOG=gity=debug
# Custom data directory (not backed up)
export GITY_HOME=/tmp/gity-dev
CI/CD Setup¶
# JSON logs for parsing
export GITY_LOG_FORMAT=json
# Minimal logging
export RUST_LOG=warn
# Ephemeral data directory
export GITY_HOME=/tmp/gity-ci
Production Setup¶
# Standard logging
export RUST_LOG=info
# Custom location with more space
export GITY_HOME=/var/lib/gity
Multiple Users¶
For shared systems with multiple users:
# Each user gets their own data directory (default behavior)
# GITY_HOME defaults to ~/.gity per user
# Or use a shared location with user subdirectories
export GITY_HOME=/shared/gity/$USER
Setting Variables Permanently¶
Linux/macOS¶
Add to ~/.bashrc, ~/.zshrc, or ~/.profile:
Windows¶
System Properties:
- Search for "Environment Variables"
- Click "Edit the system environment variables"
- Click "Environment Variables"
- Add user or system variables
PowerShell Profile:
Add to $PROFILE:
Precedence¶
Environment variables take precedence over:
- Default values
- Configuration files (when supported)
Command-line arguments take precedence over environment variables.