Answer the question
In order to leave comments, you need to log in
How to synchronize hosting and local server for easy editing?
So, the question is, are there programs like git, but only to help you create and edit a site?
I'm talking about having 2 copies of the site and database, on my computer and hosting, and when something changes, both versions are synchronized.
I edited the file, saved it and immediately updated the same file on the hosting. Same with db.
Answer the question
In order to leave comments, you need to log in
I'm using dklab_realsync, I edit all the files locally, save them and while I go to the browser they are already on the server. Now I don’t even have a web server on the local, there is no hemorrhoids with database and file synchronization. What do you wish!
What you need is git.
You write code, push it, git-hook fires, which executes deploy to your server.
To synchronize the database, use migrations that are automatically applied when deployed on the server.
All popular IDEs have built-in mechanisms for synchronizing files on the server. You can also use the version control system (if, nevertheless, you update more than one file, but let's say ... finished a piece of work - updated it). You have already been told about migrations and the database.
In general, I don’t see the point in editing files on the server or in instant deployment when changing files.
Also, let's say many IDEs support synchronization. The same PyCharm.
- synchronize the local directory with the contents of the directory on the remote server:
rsync -aqxP --progress [email protected]:/tmp/test/ /home/user/test/
- synchronize the directory on the remote server with the contents of the local directory:
rsync -aqxP --progress /home/user/test/ [email protected]:/tmp/test/
- sync on a non-standard port via SSH:
rsync -e='ssh -p 44444' -aqxP /project /webelement/ hoster.ru:/project/webelement/
You can also use the switches -vz
-v- display detailed information about the copying process
-z- compress files before transfer
Full documentation on Rsync in Russian can be found on the site: wiki.opennet .ru/Rsync
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question