Skip to content

Instantly share code, notes, and snippets.

@pomartel
Last active December 9, 2025 13:55
Show Gist options
  • Select an option

  • Save pomartel/9c597f21340ce153e381c51b20a78956 to your computer and use it in GitHub Desktop.

Select an option

Save pomartel/9c597f21340ce153e381c51b20a78956 to your computer and use it in GitHub Desktop.
Script that initializes an existing yadm git repo
#!/usr/bin/bash
REPO_URL="git@github.com:pomartel/config-files.git"
if ! command -v yadm >/dev/null 2>&1; then
pacman -S --noconfirm yadm
fi
REPO_DIR="$HOME/.local/share/yadm/repo.git"
# Only clone if the repo directory doesn't already exist
echo "Cloning yadm repository: $REPO_URL"
yadm clone -f "$REPO_URL"
echo "Force-resetting work-tree (discarding local conflicting files)..."
yadm reset --hard
echo "Done. Local dotfiles now exactly match the yadm repo."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment