We have:

  • shared hosting (linux-based), access to it via ssh, but there is no git there;
  • development environment: ubuntu 14.04, configured LAMP, local git repository.

Question: how to use these tools to organize the workflow?

Desired: at each commit to the production branch, send changes to the server.

Now: manually (

2 answers 2

Is it generally correct to keep a git on a server with a project? My project is locally stored and coded at my station, and the finished product is deployed to the server. SCP , etc.

  • one
    @Bimawa, firstly, is more reliable if the code is duplicated in the remote repository, secondly, the developer may not be one. However, in both cases, it is more convenient to use a githab, a beatback or analogues. - iksuy
  • @Bimawa, thanks for these three letters ... SCP, issue a response - this is what we need), just did not know how to write. Yes, we have a bitback - two developers. - Shilgen
  • @shilgen, I thought "Now: manually (" this is what scp meant :) - iksuy
  • @iksuy, well, it's natural, well, as @KoVadim already understood me correctly, he removed from the language. rsync for deployment is a bad tool, as it usually takes place before iteration and iteration of the pre-application project is spinning and testing. And rsync will always sync it, not according to need. Although this is also all set up and doesn’t even change the essence of ftp) - BiMaWa

I think that keeping a git repository on a working server is a bit bad. Already there were several precedents with Yandex and others.

That's right - set up a githab or gitlab where all developers can push, and keep a release branch for which to set up a hook. When pushing in this thread changes are poured on the production. They even have ready-made systems - https://developer.github.com/v3/repos/deployments/

But if from yourself, you can use rsync instead of scp. This is the same protocol, he just knows how to synchronize smartly.