0

How can I automatically (maybe using a cronjob?) push code from my FTP server (only a wordpress plugin, not the entire project) to GitHub, using PHP?

I know that you'd usually have a local environment, and then push that to GitHub and then pull from GitHub to FTP, but in this scenario, I want to change the files directly on FTP, and then every hour or half day, push to GitHub automatically. Is this even possible? It needs to commit, push and merge automatically.

We want to use this so we have the possibility to go back and look at earlier versions of the file. We've looked into GitHub API, but we can't seem to find what we need. I hope the question makes sense.

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
Nissen
  • 287
  • 3
  • 17
  • Does the host have git installed? – Lawrence Cherone Jul 03 '19 at 07:34
  • Check this link hope its help for you https://stackoverflow.com/questions/16709404/how-to-automate-the-commit-and-push-process-git – Developer Jul 03 '19 at 07:34
  • I don't think the host has git installed, no – Nissen Jul 03 '19 at 07:47
  • By far the easiest thing would be to use git directly. Doesn't sound like we're talking about any considerable amount of data, so nothing seems to require that this job runs directly on the FTP server (it's FTP, so you know, you can transfer files to and from wherever you'd like). – Peter Jul 03 '19 at 11:42

0 Answers0