/git-sync-mode

Automatically sync your git repos with Emacs

Primary LanguageEmacs Lisp

Git Sync Mode

Sync your work, automatically after save.

Usage

Install

(use-package git-sync-mode
  :vc (:url "https://github.com/justinbarclay/git-sync-mode"))

.dir-locals.el

git-sync-mode can run automatically using dir-locals, this gives you the benefit of controlling what file types it will run on.

;;; Directory Local Variables            -*- no-byte-compile: t -*-
;;; For more information see (info "(emacs) Directory Variables")

((prog-mode . ((mode . git-sync)))
 (org-mode . ((mode . git-sync))))

global mode

If you’d prefer to register your directories using custom variables there is the git-sync-global-mode and git-sync-allow-list~/~git-sync-deny-list

(use-package git-sync-mode
  :vc (:url "https://github.com/justinbarclay/git-sync-mode")
  :config
  (git-sync-global-mode)
  (add-to-list git-sync-allow-list '(/path/to/project))
  (add-to-list git-sync-deny-list '(/path/to/project/subdir))

Helper commands

  • git-sync-add-to-deny-list
  • git-sync-add-to-deny-list
  • git-sync-remove-from-deny-list
  • git-sync-remove-from-allow-list