- Dump the list of installed leaves into Brewfile:
brew bundle dump --describe - Reinstall from Brewfile:
brew bundle install - List installed tools with short description:
brew leaves | xargs brew desc --eval-all - Uninstall everything that is NOT in the Brewfile:
brew bundle --cleanup
This repository uses GNU Stow to manage symlinks from this directory to your home directory.
-
Clone the repository (standard location is
~/dotfiles):git clone <repo_url> ~/dotfiles cd ~/dotfiles
-
Install GNU Stow:
brew install stow
-
Stow everything, leveraging stowrc and ignore files
cd ~/dotfiles stow --no-folding --verbose */
Stow assumes the target for symlinks is the parent directory of where you run the command. If you are in ~/dotfiles, it will target ~/.
Before making changes, always use a "dry run" with verbose output to see exactly where links will be created.
# -n: dry run, -v: verbose, -t ~: explicitly target home
stow -nvt ~ ghosttyBy default, if a directory (like .config/ghostty) doesn't exist in your home folder, Stow may "fold" it by symlinking the entire directory from this repo. To ensure Stow creates the directory structure and links individual files instead, use the --no-folding flag.
This is safer if you want to keep your home directory organized without creating large directory symlinks that might conflict with other tools.
stow --no-folding -vt ~ nvimRun these from the root of your ~/dotfiles directory:
- Link a configuration:
stow -vt ~ <folder_name> - Remove symlinks:
stow -Dvt ~ <folder_name> - Restow (refresh links):
stow -Rvt ~ <folder_name>
If a file already exists at the target location (and isn't a symlink), Stow will refuse to overwrite it. You must move or delete the existing file before running stow.
mv ~/.zshrc ~/.zshrc.bak
stow -vt ~ zshUse this if you have an existing config in your home directory (e.g., ~/.zshrc) and you want to manage it with Stow.
Workflow to "Pull" into Repo:
-
Starting scenario
There is a "live" file e.g.
~/.config/zsh/.zshrc.
There is a folder in dotfiles e.g.~/dotfiles/zsh/.config/zsh.
Note that if~/dotfiles/zsh/.config/zsh/.zshrcexists, it will be overwritten by the adopt command. -
Run the adopt command:
cd ~/dotfiles stow -v --adopt zsh
This moves the content of
~/.config/zsh/.zshrcinto ~/dotfiles/zsh/.config/zsh/.zshrc` and then creates the symlink.