Table of contents
Open Table of contents
Introduction
GNU Stow is a symlink farm manager that makes managing dotfiles incredibly simple. Instead of manually creating symlinks or copying files around, Stow handles everything for you. Here’s how to get started.
Step 1: Check Your Existing Dotfiles
First, verify which dotfiles you want to manage. For example:
ls -la ~/.aerospace.toml
Step 2: Copy Files to Your Dotfiles Folder
Copy the files you want to manage into your dotfiles repository. The -p flag preserves file attributes:
cp -p ~/.aerospace.toml ./
Step 3: Use Stow to Create Symlinks
Run Stow with the --adopt flag. This will:
- Create symlinks from your home directory to the dotfiles folder
- Adopt any existing files (move them into the dotfiles folder if they differ)
stow --adopt .
After this, any changes in your ~ folder will be automatically synced to your dotfiles repository.
Step 4: Commit Your Changes
Don’t forget to commit your dotfiles to version control:
git add .
git commit -m "Add dotfiles configuration"
Now your dotfiles are version-controlled and can be easily synced across machines!