{"id":13862454,"url":"https://github.com/emacs-php/emacs-auto-deployment","last_synced_at":"2026-02-22T19:15:26.653Z","repository":{"id":66384707,"uuid":"99814875","full_name":"emacs-php/emacs-auto-deployment","owner":"emacs-php","description":"Copy file on save, automatic deployment it.  aka auto-deployment.","archived":false,"fork":false,"pushed_at":"2025-11-20T22:13:34.000Z","size":37,"stargazers_count":20,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-11-21T00:08:44.803Z","etag":null,"topics":["deploy","emacs","melpa"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emacs-php.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-08-09T14:02:32.000Z","updated_at":"2025-11-20T22:13:38.000Z","dependencies_parsed_at":"2024-03-27T08:29:38.758Z","dependency_job_id":"649fb401-9a4f-487b-b1df-5dd1a5ddfeb3","html_url":"https://github.com/emacs-php/emacs-auto-deployment","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/emacs-php/emacs-auto-deployment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emacs-php%2Femacs-auto-deployment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emacs-php%2Femacs-auto-deployment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emacs-php%2Femacs-auto-deployment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emacs-php%2Femacs-auto-deployment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emacs-php","download_url":"https://codeload.github.com/emacs-php/emacs-auto-deployment/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emacs-php%2Femacs-auto-deployment/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29723837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T19:15:09.475Z","status":"ssl_error","status_checked_at":"2026-02-22T19:15:09.045Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deploy","emacs","melpa"],"created_at":"2024-08-05T06:01:44.709Z","updated_at":"2026-02-22T19:15:26.623Z","avatar_url":"https://github.com/emacs-php.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"* Emacs auto-deployment\n\n#+BEGIN_HTML\n\u003ca href=\"https://melpa.org/#/copy-file-on-save\"\u003e\u003cimg alt=\"MELPA: copy-file-on-save\" src=\"https://melpa.org/packages/copy-file-on-save-badge.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://stable.melpa.org/#/copy-file-on-save\"\u003e\u003cimg alt=\"MELPA stable: copy-file-on-save\" src=\"https://stable.melpa.org/packages/copy-file-on-save-badge.svg\"\u003e\u003c/a\u003e\n#+END_HTML\n\n=copy-file-on-save= is a minor mode to copy the file to another path on [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Standard-Hooks.html][after-save-hook]].  This not only saves the backup in the project specific path, it also you can realize the deployment to the remote server over TRAMP.\n** Why =copy-file-on-save=?\nThe original name of this feature was *auto-deployment*.  It was named after [[https://confluence.jetbrains.com/display/PhpStorm/Sync+changes+and+automatic+upload+to+a+deployment+server+in+PhpStorm][JetBrains' automatic deployment function]].  But in Emacs this function can be realized by TRAMP's excellent file system abstraction layer.  That is, deploying to remote server is just done with only =copy-file= function.\n*** vs direct editing on TRAMP\nTRAMP can log in to remote server from Emacs and edit the file directly.  This means that you do not need to keep a full copy of the project on your client PC.  But at the price you will feel latency to all file system operations.\n\nThe disadvantage of TRAMP is Emacs Lisp compatibility.  Especially in the case of several packages, processing depending on the file system is lacking consideration or it may be slow even if it works.  For example, [[https://magit.vc/][Magit]] also works via TRAMP, but it's very slow.\n*** vs emacs-ssh-deploy\n[[https://github.com/cjohansson/emacs-ssh-deploy][ssh-deploy]] package is a TRAMP wrapper like =copy-file-on-save=, but it has many features such as directory recursive deployment and diff between remote and local.  If you want rich features you should use *ssh-deploy*.\n\nOn the other hand, we only provide simple functions.  We recommend using tools and scripts such as rsync and git for multi-file deployment.\n*** For deployment\nA typical use of this feature is to place PHP files on the remote development server.  However, this is useful not only for PHP but also for synchronizing files without depend on shared directory function of virtual environments ([[https://www.virtualbox.org/][VirtualBox]], [[https://www.vagrantup.com/][Vagrant]] and [[https://www.docker.com/][Docker]]).\n*** Extends TRAMP\n[[https://github.com/dougm/vagrant-tramp][vagrant-tramp]] and  [[https://github.com/emacs-pe/docker-tramp.el][docker-tramp]] increase the affinity of Emacs (TRAMP) and Vagrant/Docker, so it is worth noting.\n** API\n*** Variable\n**** =(string) copy-file-on-save-dest-dir=\nPath to deployment directory or convert (mapping) function.\n\nYou can use TRAMP's syntax.  See [[https://www.gnu.org/software/emacs/manual/html_node/tramp/Configuration.html#Configuration][Configuration - TRAMP User Manual]] and [[https://www.gnu.org/software/emacs/manual/html_node/tramp/Inline-methods.html#Inline-methods][Inline methods]].  (ex. =/scp:dest-server:/home/your/path/to/proj=)\n**** =(repeat string) copy-file-on-save-ignore-patterns=\n** Configure for each project\nThis is necessary for sharing variables in the project.\n*** Using [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html][.dir-locals.el]] (*RECOMMENDED*)\nPut the following into your =.dir-locals.el= in project root directory.\n#+BEGIN_SRC emacs-lisp\n((nil . ((copy-file-on-save-dest-dir . \"/scp:dest-server:/home/your/path/to/proj\")\n         (copy-file-on-save-ignore-patterns . (\"/cache\")))))\n#+END_SRC\nThis method uses standard functions of Emacs. However, you will feel annoying warnings from Emacs.  Please see [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Safe-File-Variables.html#Safe-File-Variables][Safe File Variables - GNU Emacs Manual]] for how to suppress this warning.\n** How to turn on =copy-file-on-save=\n*** Enable global-minor-mode (*RECOMMENDED*)\nPut the following into your =init.el= or =.emacs= file.\n#+BEGIN_SRC emacs-lisp\n(global-copy-file-on-save-mode)\n#+END_SRC\nPlease don't worry.  This mode does not work in buffers that do not have available settings for deployment.\n*** Enable manually\n=M-x copy-file-on-save-mode= will toggle enable/disable the minor mode.\n*** Using hook with [[https://github.com/joewreschnig/auto-minor-mode][auto-minor-mode]]\n#+BEGIN_SRC emacs-lisp\n;; Example for full directory path to your project.\n(add-to-list 'auto-minor-mode-alist `(,(format \"^%s/work/your-project/\" (getenv \"HOME\")) . copy-file-on-save-mode))\n;; You can ommit path if it is enough specific your project.\n(add-to-list 'auto-minor-mode-alist '(\"/work/your-project/\" . copy-file-on-save-mode))\n#+END_SRC\n** Changelog\nSee also [[/CONTRIBUTORS.org][CONTRIBUTORS]].\n*** v0.0.3\n- *[ENHANCEMENT,BUG]* Fixed saving failed when there was no directory.  /(Thanks @Csomnia)/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femacs-php%2Femacs-auto-deployment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femacs-php%2Femacs-auto-deployment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femacs-php%2Femacs-auto-deployment/lists"}