{"id":3073,"date":"2013-04-10T08:22:12","date_gmt":"2013-04-10T08:22:12","guid":{"rendered":"https:\/\/www.combell.com\/en\/blog\/?p=3073"},"modified":"2015-06-03T17:36:03","modified_gmt":"2015-06-03T15:36:03","slug":"software-deployment-with-git-and-svn-via-ssh","status":"publish","type":"post","link":"https:\/\/www.combell.com\/en\/blog\/software-deployment-with-git-and-svn-via-ssh\/","title":{"rendered":"Software deployment with Git and SVN via SSH"},"content":{"rendered":"<p>Since the launch of the SSH access to our Linux shared hosting environment, you have the Git and SVN binaries at your disposal. Not only do they allow you to perform version control, but they also allow to pull data. In other words, you can deploy from a source control repository.<\/p>\n<p>If you work using tags and branches, you can send a specific version of your software to our environment. And you can do this even if you are still in the midst of developing your application in another branch of your repository.<\/p>\n<p><!--more-->There are two possible strategies you can use:<\/p>\n<ul>\n<li>Export the data of your branch so only the files on your package are stored<\/li>\n<li>Extract the branch of your project and thus also store server and revision information<\/li>\n<\/ul>\n<p><strong>Subversion<\/strong><\/p>\n<p>Subversion, also known as SVN, is a very traditional way of performing version control. The basic strategy is that there is a single central server where all the code is stored in its different versions. All deployment is performed from that central server. In the meantime, Subversion has become an Apache top-level project. On the <a href=\"http:\/\/subversion.apache.org\/\" target=\"_blank\" rel=\"noopener\">official website<\/a>, you can read more on the way SVN works.<\/p>\n<p>We only provide an SVN client on our environment, not a server. The idea is that you connect with your Subversion server from our hosting.<\/p>\n<p><em>Examples:<\/em><\/p>\n<p>To export an SVN branch to your package, you can e.g. use the following command:<\/p>\n<pre>svn export <span style=\"text-decoration: underline;\"><a href=\"http:\/\/your.svn.server\/repo\/trunk\/\" target=\"_blank\" rel=\"noopener\">http:\/\/your.svn.server\/repo\/trunk\/<\/a><\/span> .<\/pre>\n<p>The abovementioned command will connect to your SVN server (which runs on \u201cyour.svn.server\u201d) and address the repository \u201crepo\u201d. In this case, the \u201ctrunk\u201d branch of this repository is pulled.<\/p>\n<p>You can also extract a branch. This is how you do it:<\/p>\n<pre>svn co <span style=\"text-decoration: underline;\"><a href=\"http:\/\/your.svn.server\/repo\/trunk\/\" target=\"_blank\" rel=\"noopener\">http:\/\/your.svn.server\/repo\/trunk\/<\/a><\/span> .<\/pre>\n<p>The files of this branch will also end up on your package, but a \u201c.svn\u201d map will also be created in order to store the revision information. Via an \u201csvn up\u201d command, you can pull possible changes automatically. Besides, you can also send back changes via the \u201csvn commit\u201d command.<\/p>\n<p><strong>Git<\/strong><\/p>\n<p>Even though Git is quite old and used to be mostly used as a version control tool for maintenance of the Linux kernel, it has currently become a standard. As opposed to Subversion, there can be more than one server involved with Git. Git works in a distributed manner and repositories can be synchronized in both directions. You can find more information on how this works on the official website of Git.<\/p>\n<p>You can also create a new Git repository on your package and store possible changes, which you can synchronize with other repositories. Despite the fact that this is an interesting way to work, we use a pull strategy for deployments rather than a push strategy.<\/p>\n<p><em>Examples:<\/em><\/p>\n<p>To pull a Git repository, you can use the following command:<\/p>\n<pre>git clone --depth=1 git:\/\/github.com\/username\/repo.git .<\/pre>\n<p>The abovementioned command will establish a connection with your Git server (in this case, github.com) and address the repository \u201crepo\u201d. This repository runs within your account, here represented by \u201cusername\u201d.<\/p>\n<p>The \u201cGit clone\u201d command is the equivalent of \u201csvn co\u201d. In other words: information on versions is also retrieved and stored in the \u201c.git\u201d folder. This way, you can contribute to this repository and forward modifications.<\/p>\n<p>If you want to limit yourself to exporting data, you can remove the \u201c.git\u201d folder after the \u201cgit clone\u201d. This is how you do it:<\/p>\n<pre>rm \u2013rf .git<\/pre>\n<p>If you want to kill two birds with one stone, you can combine both commands as follows:<\/p>\n<pre>git clone --depth=1 git:\/\/github.com\/username\/repo.git . &amp;&amp; rm \u2013rf .git<\/pre>\n<p>The \u201c--depth=1\u201d parameter limits the amount of version information retrieved. If you do not want to limit this, then do not use this parameter.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since the launch of the SSH access to our Linux shared hosting environment, you have the Git and SVN binaries at your disposal. Not only do they allow you to...<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[66],"tags":[],"acf":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"post-featured":false,"post-featured-opt":false,"post-featured-opt-md":false,"post-featured-opt-sm":false,"post-featured-opt-xs":false,"post-most-popular":false,"post-author":false},"uagb_author_info":{"display_name":"Jimmy Cappaert","author_link":"https:\/\/www.combell.com\/en\/blog\/author\/jimmy\/"},"uagb_comment_info":0,"uagb_excerpt":"Since the launch of the SSH access to our Linux shared hosting environment, you have the Git and SVN binaries at your disposal. Not only do they allow you to...","_links":{"self":[{"href":"https:\/\/www.combell.com\/en\/blog\/wp-json\/wp\/v2\/posts\/3073"}],"collection":[{"href":"https:\/\/www.combell.com\/en\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.combell.com\/en\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.combell.com\/en\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.combell.com\/en\/blog\/wp-json\/wp\/v2\/comments?post=3073"}],"version-history":[{"count":3,"href":"https:\/\/www.combell.com\/en\/blog\/wp-json\/wp\/v2\/posts\/3073\/revisions"}],"predecessor-version":[{"id":3082,"href":"https:\/\/www.combell.com\/en\/blog\/wp-json\/wp\/v2\/posts\/3073\/revisions\/3082"}],"wp:attachment":[{"href":"https:\/\/www.combell.com\/en\/blog\/wp-json\/wp\/v2\/media?parent=3073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.combell.com\/en\/blog\/wp-json\/wp\/v2\/categories?post=3073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.combell.com\/en\/blog\/wp-json\/wp\/v2\/tags?post=3073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}