V
V
Vyacheslav Klimov2020-03-07 10:49:27
git
Vyacheslav Klimov, 2020-03-07 10:49:27

How to properly edit a site with git?

Here is a site. He is on a host with his own domain in his server environment, etc. That is, in a reliably working form, it exists in one place in one copy.
Usually, when I need to make some changes to the site code, I connect via ftp and make changes, then I check the functionality in the browser, if necessary, I edit again 1-2-10-50 ... times until the desired result is achieved. then I just finish the job. It's quick and easy, and the result is visible immediately.
This approach has the disadvantage of not having version control. You need to use git. But how to do it?
So I install git for myself, create a repository on github, create a local copy on my computer. Now I can edit on my computer and store on github, and then upload files to the host from github. But checking the code on the local machine is now blind, without a quick check, and uploading changes to the site becomes a long and tedious operation.
I come to the conclusion that I misunderstand something in the approach to this work, but I have not been able to find any kind of manual for this task. All explanations revolve between local and github when developing applications.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2020-03-07
@KlVV

I can suggest the following options:

  • Make it so that you do not have to check so carefully after updating on a remote server. Customize your local environment for the best fit.
  • Get a subdomain on the server, like dev.mysite.org and check everything there as convenient before updating the product
  • Don't use git on prod. Versioning is for the code, not the server. There you can at least pour an archive.

Well, as a combo option, start using ci / cd, the same Travis. The branch with the prepared release was updated - automatically poured onto the server via scp / sftp with a subdomain address. Did everything work out? Merge into the master and automatically (in fact, it's better manually or with a git tag limit) went to prod.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question