V
V
Vasily G.2016-03-10 15:37:29
git
Vasily G., 2016-03-10 15:37:29

(git) How to organize the work of the local and production versions of the site?

Hello.
Need help setting up the site.
Now it's done like this:
1. Deployed a VirtualBox virtual machine with a CentosOS console, set up a web server there.
2. The computer is running Windows and the phpStrom editor, a connection has been established to the virtual server. All changes are automatically uploaded to the local server.
3. I have an account on gitlab.com where I upload all changes from the local server.
4. On the production site (site.com) I do a git pull from gitlab.com
How can this process be improved?
I also want to make a beta domain (for example, beta.site.com), first upload new functionality there, test it, show it to the customer, and only then upload everything to production.
What are useful articles to read?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
evnuh, 2016-03-10
@evnuh

This is the fourth time I've answered a similar question:
Actually, how we do it - toroid.org/ams/git-website-howto . This is the deployment process. I added two remotes to my local repository - prod & test. This is in addition to origin, which points to your shared bare git repository, on github, for example. Sobsno, first I upload it for testing with one command
, then, if everything is fine, already for production
. If any post-processing is needed, then they occur on the server through the hooks of the git.
About workflow. The simplest option is Github Flow.
There is one branch, master - there is always what is currently on sale.
To make a feature/fix a bug you create a new branch from master, commit to it, when done merge it to master. Before merging, of course, update your master, suddenly someone has already merged their branch with another feature there. Do you want to test your feature before the merge?
this will push your branch to the test server.

A
Anton Tikhomirov, 2016-03-11
@Acuna

I have everything just like an ax! There is a batch file with prescribed commands
git commit, git push, git pull, and further according to the situation, which starts automatically at the time of project build (in short, when you start it))) ), he commits everything to Git, and he also deploys everything to a remote server via sFTP (which via SSH with certificates) using the winscp console utility (because sFTP) with appearances from a separate config, which lies with the batch file, so it can be easily changed without affecting the batch file itself. That is, they sent it to Git, synchronized everything with the local version, if everything is fine, then deployed it to the remote one. And that's all. There is only one minus: for now, you can only work with one branch. But it's all just a matter of upgrading the batch file itself (I just don't have such a need). Honestly, I don’t know why everyone is given such furious instructions when answering questions of this kind, but as for me, everything ingenious is simple. Not,

A
Andrey, 2016-03-10
@VladimirAndreev

git-flow

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question