This repository restores the same dotfiles on macOS and Linux. The yadm work
tree is $HOME, and restored devices use the master branch.
Install Git and yadm, and make sure the device can access this repository over SSH.
Disable automatic alternates until the platform has been selected, then clone without running the bootstrap script:
yadm config yadm.auto-alt false
yadm clone -b master --no-bootstrap \
git@github.com:JoverZhang/dotfiles.gitOn a new device, continue with Select the Platform.
On an existing device, first inspect any files that differ from the repository:
cd "$HOME"
yadm status --short
yadm diffBack up each conflicting file outside $HOME, then restore only the paths you
intend to replace:
yadm checkout -- .path/to/fileDo not run yadm checkout "$HOME" or move the entire .config directory.
yadm detects the operating system automatically from uname; it matches macOS
as Darwin and Linux as Linux. Only Linux desktop systems need an additional
class.
| Platform | Selection |
|---|---|
| macOS | os=Darwin, detected automatically |
| Standard Linux or server | os=Linux, detected automatically |
| Linux desktop | os=Linux plus class=Desktop |
For a Linux desktop, set the local class:
yadm config --replace-all local.class DesktopFor macOS or standard Linux, clear any class left from an earlier setup:
yadm config --unset-all local.class 2>/dev/null || trueThe class is stored only in the device's local yadm configuration and is not committed to the repository.
Generate the files for the selected platform and install the tracked submodules and external dependencies:
cd "$HOME"
yadm alt
yadm bootstrap
yadm config yadm.auto-alt trueVerify the restored repository:
yadm status --short
yadm submodule status --recursiveyadm status --short should produce no output.