0

My need would be to figure out if I can do something like this (keeping in mind the answer of @jrtapsell described here):

  1. I would like to install Git directly on the server where I currently host the three versions of the app I am developing (this is a Linux server, where each version is a separate host from the other, so, for example, /home/develop/public_html contains the files of develop version the same way as testing and production)
  2. I would like to eliminate, at this point, totally having to use something to execute SFTP upload of files already handled with Git
  3. Ideally, therefore, I would like each host to be part of the same Git repository, so I can automatically send the files to each one without needing to upload with SFTP

At this point I wonder: is it possible to work with such a workflow? And, above all, can each host be a portion of the same repository?

Thanks so much.

5
  • Why aren't you already using branches for each version?
    – xenoid
    Commented Sep 13, 2017 at 9:23
  • I'm still not very practical about git: branches can certainly work on the same web host (so where all three versions of the software are under the same Linux account, as described here) but I do not know if it can run on separate hosts (/home/develop/public_html, home/testing/public_html and /home/production/public_html). Is it possible?
    – mimet
    Commented Sep 13, 2017 at 9:50
  • If you need specific code in /home/{develop|testing|production}/public_html then you would have a single repository somewhere outside of these three, and something that checks out a given branch and copies it to /home/{develop|testing|production}/public_html periodically or on demand (with some continuous integration software you can even have this triggered by a commit to the branch, or you can do it yourself with git hooks on the server)).
    – xenoid
    Commented Sep 13, 2017 at 12:24
  • It could be a great solution! Do you have any scripts / software / hook to advise me for periodic checks?
    – mimet
    Commented Sep 13, 2017 at 15:24
  • git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
    – xenoid
    Commented Sep 13, 2017 at 21:07

0

You must log in to answer this question.

Browse other questions tagged .