I've got a production server I'm managing right now, but it's becoming incredibly inefficient to either:

  1. SSH into the remote server, and develop server-side
  2. Develop on my local machine and transfer changes to remote server

A possible remedy that came to mind was keeping a git repo that mirrored the filesystem of the remote-server (so the server's /var/www/html/ would be REPO/var/www/html), and then on push, having a git hook hardlink all of the files to their appropriate directories. Everything I'm currently pushing is just configs(e.g Nginx.conf)/interpreted files (e.g HTML/JS), so I don't see any issues popping up there. Even for compiled items, it seems to be as simple as using the same CPU architecture, during building, and then relinking server-side.

Am I missing something? I see only benefits here.

  • 1
    see What is the problem with "Pros and Cons"? – gnat Mar 2 '18 at 16:36
  • @gnat Fixed. Is this compliant? – user297624 Mar 2 '18 at 16:38
  • 2
    Have you considered using some kind of automation to ease this process? Git is a source control system, not a Continuous Deployment system. It's probably the wrong tool for this. – Robert Harvey Mar 2 '18 at 16:52
  • It seems you're actually looking for something like SFTP or rsync, not a version control repository. Those two protocols can use SSH as a transport. – amon Mar 2 '18 at 16:59
  • @RobertHarvey I was considering CIs like Travis/Jenkins/Concourse, but they seem like overkill for something that I can achieve with a small githook/bash script. I don't need to build or test anything, besides what I run on my end. – user297624 Mar 2 '18 at 17:17

"If you have to ssh to your prod box, your automation has failed" (q).


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.