Use rsync to sync your project to server. Use syncd to automate it.
attaching installation process
-
Install rsync
-
Get syncd from https://github.com/codeasashu/syncd.git (branch: direction)
-
copy syncd and watch.sh to /usr/local/bin so you can execute it directly in terminal
cp syncd /usr/local/bin
cp watch.sh /usr/local/bin
-
Create your project directory anywhere on system. For ex- I created project abc in /var/www/html
-
in /var/www/html/abc, create syncd.conf(use the one from clone above)
-
Modify SSH access and put any key file if you use for authentication.
-
First set REMOTE_TO_LOCAL=true to fetch all the files and data from remote to local
-
Set REMOTE_TO_LOCAL=false now. Start editing.
-
When finished editing, just open terminal and run these:
cd /var/www/html/abc
syncd run
It will update your changes to remote.
NOTE: Remember to have backup of remote files before using this process