I\'m trying to .gitignore emacs temporary/autosave files. I\'m using...
\\.\\#.*
in my .gitignore.
But git add -A
run in
You can also instruct emacs to save the autosave files in a different directory altogether by setting the variable auto-save-file-name-transforms
, I have this in my init file
(setq auto-save-file-name-transforms
`((".*" ,(concat user-emacs-directory "auto-save/") t)))
This instructs emacs to store the auto-saves inside the auto-save
folder in the user-emacs-directory (usually ~/.emacs.d
).
To save backup files in a different directory set the variable backup-directory-alist
, the following will save backup files inside backups
folder in the user-emacs-directory
(setq backup-directory-alist
`(("." . ,(expand-file-name
(concat user-emacs-directory "backups")))))