{"id":19129,"date":"2013-10-08T14:43:52","date_gmt":"2013-10-08T14:43:52","guid":{"rendered":"https:\/\/blog.jetbrains.com\/phpstorm\/?p=6597"},"modified":"2024-01-09T15:00:34","modified_gmt":"2024-01-09T14:00:34","slug":"deploying-committed-changes-to-a-remote-server","status":"publish","type":"phpstorm","link":"https:\/\/blog.jetbrains.com\/phpstorm\/2013\/10\/deploying-committed-changes-to-a-remote-server\/","title":{"rendered":"Deploying Committed Changes to a Remote Server"},"content":{"rendered":"<p>Recently, we received the following question through <a href=\"https:\/\/twitter.com\/tvlooy\/status\/380324422579519488\" target=\"_blank\" rel=\"noopener\">Twitter<\/a>: \u201cWhat is the easiest way to deploy the changes of your last commit(s) to a remote project?\u201d<\/p>\n<p><a href=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2013\/10\/phpstorm-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-6598\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2013\/10\/phpstorm-1.png\" alt=\"\" width=\"455\" height=\"188\" \/><\/a><\/p>\n<p>Let&#8217;s explore our options!<\/p>\n<p><!--more--><\/p>\n<p dir=\"ltr\"><em>This functionality is available in <a href=\"http:\/\/www.jetbrains.com\/idea\/\" target=\"_blank\" rel=\"noopener\">IntelliJ Idea<\/a>, <a href=\"http:\/\/www.jetbrains.com\/pycharm\/\" target=\"_blank\" rel=\"noopener\">PyCharm<\/a>, <a href=\"http:\/\/www.jetbrains.com\/webstorm\/\" target=\"_blank\" rel=\"noopener\">WebStorm<\/a>, <a href=\"http:\/\/www.jetbrains.com\/phpstorm\/\" target=\"_blank\" rel=\"noopener\">PhpStorm<\/a>, and <a href=\"http:\/\/www.jetbrains.com\/ruby\/\" target=\"_blank\" rel=\"noopener\">RubyMine<\/a>.<\/em><\/p>\n<h2>Configuring a Remote Host<\/h2>\n<p>Working with a <a href=\"http:\/\/www.jetbrains.com\/phpstorm\/webhelp\/working-with-web-servers-copying-files.html\" target=\"_blank\" rel=\"noopener\">Remote Host<\/a> is a broad topic of its own. To add a remote host, select <em><strong>Tools | Deployment | Configuration <\/strong><\/em>and provide the necessary details to connect to the remote host. This can be an FTP, FTPS or SFTP server as well as a local or remote folder. In this blog post we\u2019ll use a remote server as a host which is accessed through FTP.<\/p>\n<p><a href=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2013\/10\/phpstorm-2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-6599\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2013\/10\/phpstorm-2.png\" alt=\"\" width=\"640\" height=\"588\" \/><\/a><\/p>\n<p>On the <strong>Mappings <\/strong>tab, we can also specify how the local and remote folder structure compare to each other. For example, we can map the local project root to a different content folder on the server.<\/p>\n<p><a href=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2013\/10\/phpstorm-3.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-6600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2013\/10\/phpstorm-3.png\" alt=\"\" width=\"467\" height=\"268\" \/><\/a><\/p>\n<p dir=\"ltr\">Once finished, <em><strong>Tools | Deployment | Browse Remote Host <\/strong><\/em>will reveal the remote file browser. We can <a href=\"https:\/\/blog.jetbrains.com\/webide\/2013\/03\/drag-drop-project-files-to-remote-hosts-in-phpstorm\/\">Drag &amp; Drop files<\/a> between the current project and the server and make use of synchronization.<\/p>\n<h2>Uploading files on commit<\/h2>\n<p dir=\"ltr\">Let\u2019s return to the initial question: how to deploy to this server when committing files to a VCS? Once a VCS system, whether Git, Mercurial, Subversion or another is registered for our project, we can make a change to our code and press <em><strong>Ctrl+K<\/strong><\/em> (<em><strong>Cmd+K on Mac OS X<\/strong><\/em>) to commit changes.<\/p>\n<p dir=\"ltr\">The <em>Commit Changes <\/em>dialog provides us with the option to upload files to a remote server after a successful commit. There is also a checkbox available which will automatically perform the upload after every commit.<\/p>\n<p dir=\"ltr\"><a href=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2013\/10\/phpstorm-4.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-6601\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2013\/10\/phpstorm-4.png\" alt=\"\" width=\"661\" height=\"593\" \/><\/a><\/p>\n<h2 id=\"docs-internal-guid-4b73ddf3-781e-4c83-548e-e93038b936c3\">Considerations<\/h2>\n<p dir=\"ltr\">The automatic upload process for a commit only transfers the current changeset\u2019s files to the remote host. All preceding commits will be ignored by this process.<\/p>\n<p dir=\"ltr\">For a single developer, this workflow is ideal. After doing an initial synchronization between the current project and the remote server, every commit will be sent to the remote host (as long as it\u2019s committed through PhpStorm).<\/p>\n<p dir=\"ltr\">In a team, not every developer is always working on the latest version of the VCS repository. If every developer uploads only their last commit to the remote host, chances are some files deployed will not be the latest ones and several commits will never make it to the server.<\/p>\n<p dir=\"ltr\">It is important for teams to do the deployment using a standardized flow, preferably automated. This can be done using a Continuous Integration (CI) server, <a href=\"https:\/\/blog.jetbrains.com\/teamcity\/2013\/07\/first-class-php-continuous-integration-using-teamcity\/\">TeamCity<\/a> for example, which fetches the latest commit, runs PHPUnit and deploys it to the target machine.<\/p>\n<p dir=\"ltr\">Let us hear your thoughts in the <a href=\"http:\/\/youtrack.jetbrains.com\/issues\/WI\" target=\"_blank\" rel=\"noopener\">issue tracker<\/a>, through the comments below or in our <a href=\"http:\/\/devnet.jetbrains.com\/community\/wi?view=discussions\" target=\"_blank\" rel=\"noopener\">forums<\/a>!<\/p>\n<p dir=\"ltr\"><em>Develop with pleasure!<\/em><br \/>\n<em>\u2013 JetBrains PhpStorm Team<\/em><\/p>\n","protected":false},"author":118,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","categories":[808,907],"tags":[379,743,190,1030,1106,284],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/pt-br\/wp-json\/wp\/v2\/phpstorm\/19129"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/pt-br\/wp-json\/wp\/v2\/phpstorm"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/pt-br\/wp-json\/wp\/v2\/types\/phpstorm"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/pt-br\/wp-json\/wp\/v2\/users\/118"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/pt-br\/wp-json\/wp\/v2\/comments?post=19129"}],"version-history":[{"count":1,"href":"https:\/\/blog.jetbrains.com\/pt-br\/wp-json\/wp\/v2\/phpstorm\/19129\/revisions"}],"predecessor-version":[{"id":432170,"href":"https:\/\/blog.jetbrains.com\/pt-br\/wp-json\/wp\/v2\/phpstorm\/19129\/revisions\/432170"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/pt-br\/wp-json\/wp\/v2\/media?parent=19129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/pt-br\/wp-json\/wp\/v2\/categories?post=19129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/pt-br\/wp-json\/wp\/v2\/tags?post=19129"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/pt-br\/wp-json\/wp\/v2\/cross-post-tag?post=19129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}