dot
is a minimalist dotfiles manager that leverages git for version control while keeping your configuration files in their original locations. It works by maintaining a separate dotfiles repository and automatically syncing tracked files between their original locations and the repository.
The main philosophy is to delegate as much functionality as possible to git while providing a thin convenience layer for tracking and syncing files.
- Simple, bash-based implementation
- Uses git for version control
- Keeps files in their original locations
- Automatic syncing of tracked files
- Supports any git command
- Verbose output options for debugging
- Download
dot.sh
and make it executable:
curl -o ~/.local/bin/dot https://raw.githubusercontent.com/snth/dot/main/dot.sh
chmod +x ~/.local/bin/dot
- Set up your shell environment:
# Add to your .bashrc or .zshrc
eval "$(dot env)"
- Initialize your dotfiles repository:
dot init
dot [options] [command] [args]
Options:
-v Enable verbose output
-vv Enable debug output
Commands:
init Initialize new dotfiles repository
track [path] Start tracking file at [path] in dotfiles
cd Open a shell in the dotfiles directory
env Output shell configuration
[git-cmd] Any git command (executed in dotfiles directory)
Here's a typical workflow for managing your dotfiles:
# Initialize a new dotfiles repository
dot init
# Start tracking some config files
dot track ~/.bashrc
# Check status of your dotfiles
dot status
# Make some changes to .bashrc
echo -e '# dot for dotfiles management\neval "$(dot env)"' >> ~/.bashrc
# Review and commit changes
dot diff
dot commit -am "Added dot to ~/.bashrc"
# Push to a remote repository
dot remote add origin git@github.com:${GITHUB_USER}/dotfiles.git
dot push -u origin main
# Later, on another machine
git clone git@github.com:${GITHUB_USER}/dotfiles.git ~/.config/dotfiles
# Copy files to their correct locations
dot checkout main
-
When you run
dot track <file>
, the file is copied to your dotfiles repository (default:~/.config/dotfiles
) while maintaining its relative path structure from your home directory. -
When you run
dot cd
, the script:- Syncs any changes from your home directory to the repository
- Opens a shell in the repository directory
- When you exit, syncs any changes back to your home directory
-
All other commands are passed directly to git, with paths automatically translated relative to your home directory.
DOT_DIR
: Override the default dotfiles location (~/.config/dotfiles
)