dotfiles
This repository contains my personal dotfiles, managed using GNU Stow.
Using stow ensures that all configuration files are cleanly symlinked into your home directory, mirroring the structure of this repository.
Requirements
A script is provided to help install the core dependencies across macOS and common Linux distributions (Ubuntu/Debian, Arch, Fedora).
To run the installation script:
./scripts/install_dependencies.sh
Alternatively, you can manually install the required tool:
To install Stow on macOS, use Homebrew:
brew install stow
To install Stow on Linux, use your distribution's package manager:
Ubuntu / Debian
sudo apt install stow
Arch Linux
sudo pacman -S stow
Installation
To install all configurations at once, navigate to the root of this repository and run:
stow */
(Note: Using stow */ prevents the shell from passing pure files like README.md to Stow, ensuring only directory packages are stowed).
This will automatically create the necessary symlinks in your $HOME directory.
Removing Configurations
If you want to remove the symlinks created by Stow, use the -D flag:
stow -D */
Directory Structure & Branching Strategy
This repository uses a Folder-Per-App structure combined with a Git Branching Strategy to flawlessly handle different machines (Mac, Work, Linux) without any if/else logic.
1. Folder Structure
The root directories represent individual applications:
.
├── bash/ # Stowed to ~ (contains .bashrc)
├── nvim/ # Stowed to ~/.config/nvim/
├── tmux/ # Stowed to ~ (contains .tmux.conf)
├── zsh/ # Stowed to ~ (contains .zshrc)
└── ...
2. The Git Branch Workflow
This repository has zero conditional logic. Configurations are managed purely via branches.
masterbranch: Contains the 95% common base configurations shared across all machines.mac,work,linuxbranches: Machine-specific branches derived frommaster.
How to manage machine-specific settings:
- Check out your machine's branch (e.g.,
git checkout work). - Statically write your overrides (e.g., adding a Work-only plugin to
nvim/). - Commit and push:
git push origin work.
How to update shared settings:
- Switch to the base branch:
git checkout master. - Update the shared configuration and commit.
- Switch back to your local branch:
git checkout work. - Pull the updates in by rebasing:
git rebase master(thengit push origin work -f).
Adding New Configurations
When you want to add a new tool:
- Create a new folder matching the application's name (e.g.,
mkdir alacritty). - Replicate the target directory structure inside it (e.g.,
alacritty/.config/alacritty/alacritty.toml). - Run
stow */from the root of this repository to link the new package.