In this tutorial, you'll learn how to set up and use this dotfiles repository on a new macOS system. By the end, you'll have a fully configured development environment with version-controlled settings.
- macOS 12.0 or later
- Administrator access to your machine
- Basic familiarity with the terminal
- How to install required dependencies
- How to clone and set up the dotfiles repository
- How to apply configurations using GNU Stow
- How to verify your installation
First, install Homebrew, the package manager for macOS:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"After installation, add Homebrew to your PATH:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"Expected output:
==> Installation successful!
==> Homebrew has enabled anonymous aggregate analytics
==> Next steps:
- Run these commands in your terminal to add Homebrew to your PATH
Install GNU Stow to manage symlinks:
brew install stowVerify the installation:
stow --versionExpected output:
stow (GNU Stow) version 2.3.1
Create a directory for your dotfiles and clone the repository:
cd ~
git clone https://github.com/yourusername/dotfiles.git ~/.dotfiles
cd ~/.dotfilesExpected output:
Cloning into '/Users/yourusername/.dotfiles'...
remote: Enumerating objects: 123, done.
remote: Counting objects: 100% (123/123), done.
List the available configuration modules:
ls -laYou'll see directories like:
git/- Git configuration and aliaseszsh/- Zsh shell configurationvim/- Vim editor settingshomebrew/- Homebrew packages and casks
Start by applying the git configuration:
stow gitThis creates symlinks from your home directory to the git configuration files.
Important security step for Git configuration:
# Copy the template to create your local config
cp ~/.gitconfig.local.template ~/.gitconfig.local
# Edit to add your personal GPG key (if you use commit signing)
$EDITOR ~/.gitconfig.localApply the shell configuration:
stow zshExpected behavior:
~/.gitconfig→~/.dotfiles/git/.gitconfig~/.gitconfig.local.template→~/.dotfiles/git/.gitconfig.local.template~/.config/git/ignore→~/.dotfiles/git/.config/git/ignore~/.zshrc→~/.dotfiles/zsh/.zshrc~/.zshenv→~/.dotfiles/zsh/.zshenv
The Zsh configuration uses the Znap plugin manager. Install required dependencies:
# Clone Znap
git clone --depth 1 https://github.com/marlonrichert/zsh-snap.git ~/znap/zsh-snap
# Install Starship prompt
brew install starshipApply the new configuration by restarting your shell:
exec zshYou should see your new prompt with the Starship theme.
Check that configurations are properly linked:
# Check git configuration
git config --global user.name
# Check if aliases are loaded
git st # Should work as 'git status'
# Check shell configuration
echo $ZDOTDIR # Should show ~/.config/zshApply other configurations as needed:
# Vim configuration
stow vim
# Homebrew bundle
stow homebrew
brew bundle --file=~/.config/homebrew/BrewfileYou've successfully:
- Installed the required tools (Homebrew, GNU Stow)
- Cloned your dotfiles repository
- Applied git and shell configurations
- Verified the installation
Your development environment is now version-controlled and reproducible!
- Explore customizing your shell
- Learn how to add new configurations
- Understand the architecture of this setup
Stow conflicts: If you see "existing target is not a symlink" errors:
# Remove the existing file
mv ~/.gitconfig ~/.gitconfig.backup
# Try stow again
stow gitShell not loading configuration: Ensure your shell is set to Zsh:
chsh -s $(which zsh)Permission errors: Some operations might require sudo:
sudo stow systemwide # For system-wide configs