0

I have a Github repo on my PC that I use regularly to update and push changes. The code pushed to the repo needs to be able to be run on a couple of different servers. Currently, I remote into the server that I need to run the script on and either run a fetch or copy over the newest code from my machine. I'm looking for a way to ALWAYS keep the folder on the servers up-to-date with master. Is there a way to auto fetch every time something is pushed to Git? I will never make edits on these servers, so they'll never even need the ability to push on their own.

  • You can add a hook to push to the servers – Mad Physicist Apr 13 '21 at 18:30
  • Just setup a scheduled task that periodically pulls from the central server, and they'll automcatically receive the changes after the times goes out. – Alejandro Apr 13 '21 at 18:30
  • 2
    Does this answer your question? [How to set up a Git hook so that after pushing to ssh://peter@foo.com/~/bar.com.git, it will go to ~/bar.com and do a git pull?](https://stackoverflow.com/questions/5769568/how-to-set-up-a-git-hook-so-that-after-pushing-to-ssh-peterfoo-com-bar-com) – Mad Physicist Apr 13 '21 at 18:32
  • 1
    @Alejandro git lets you make that process event based – Mad Physicist Apr 13 '21 at 18:33

0 Answers0