Home  >  Article  >  Backend Development  >  How to use web/phpstorm to automatically synchronize local code to a remote server (picture and text)

How to use web/phpstorm to automatically synchronize local code to a remote server (picture and text)

不言
不言forward
2019-03-27 09:40:014797browse

The content of this article is about how to use web/phpstorm to automatically synchronize local code to a remote server (pictures and texts). It has certain reference value. Friends in need can refer to it. I hope it will be useful to you. helped.

Scenario: If the development and testing environments are different, or the machine used frequently is Windows, the project requires liunx. At this time, I choose to install liunx on the virtual machine, deploy the ssh service, install winscp on the host with putty, and use webstorm for development. For the current mainstream webpack hot compilation of the web front end, it is really tiring to transfer files to the virtual machine from time to time, so I chose the automatic synchronization of the tool.

Settings

Configuration basic information

Select Tools – Deployment – ​​Configuration in the webstom editor, add a remote host, this name is just for notes, write whatever you want, select the protocol FTP (also supports SFTP, local, etc.)

How to use web/phpstorm to automatically synchronize local code to a remote server (picture and text)

How to use web/phpstorm to automatically synchronize local code to a remote server (picture and text)

At this time, the main thing is to fill in the FTP information of the remote host, in addition to the basic FTP information In addition to filling in, you also need to fill in the following information:

Root path  //这个选项是要打开的路径,这样做主要是为了防止误操作影响项目,填写后上级目录不会展示,当然你可以不写

Web server root URL   //这里就是调试的网址

In addition, you need to configure the file mapping between local and server, as shown in the figure below:

How to use web/phpstorm to automatically synchronize local code to a remote server (picture and text)

Finally , we can then adjust the mapping between local and remote hosts. If you want to add multiple remote hosts, remember to click Use this server as default on the item you want to use.
After the remote host is configured, we can take a look at the directory structure. Click Tools – Deployment – ​​Broswse Remote Host, and then you will see the remote files.

Set up synchronization

How to use web/phpstorm to automatically synchronize local code to a remote server (picture and text)

But to achieve synchronization at this time, manual transmission is still required. It is still a little short of automation. Open Tools – Deployment – ​​Options. We changed the Upload changed files item to On explicit save action, which means that each save will be synchronized to the remote server.

How to use web/phpstorm to automatically synchronize local code to a remote server (picture and text)

This article has ended here. For more other exciting content, you can pay attention to the PHP Video Tutorial column on the PHP Chinese website!

The above is the detailed content of How to use web/phpstorm to automatically synchronize local code to a remote server (picture and text). For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete