Snippets and other bits

Using yadm via magit

Jul 25, 2021

Yadm’s an amazing dotfile manager that’s basically a thin wrapper around git and a bare repo. With it being a bare repo, you’ll not be able to manage it directly with Magit so here’s a really smart tip I found that will let you access it via Tramp:

(use-package tramp
  :config
  (add-to-list 'tramp-methods
               '("yadm"
                 (tramp-login-program "yadm")
                 (tramp-login-args (("enter")))
                 (tramp-login-env (("SHELL") ("/bin/sh")))
                 (tramp-remote-shell "/bin/sh")
                 (tramp-remote-shell-args ("-c")))))

(defun yadm ()
  (interactive)
  (magit-status "/yadm::"))

← Back to root