Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is pretty easy to achieve and is nothing specific to GIT, but depends on your webserver settings and the deployment process for your app. 2 easy steps:</p> <ol> <li>Configure your web server to serve both www.foobar.com and beta.foobar.com. Serve the different domains from different web-roots, e.g. main app from <code>/var/www/foobar.com/app/public</code> and subdomain from <code>/var/www/foobar.com/subdomains/beta/public</code></li> <li>For deployment, simply clone the master branch into <code>.../app/public</code> directory and the beta branch into <code>.../subdomains/beta/public</code></li> </ol> <p>The process can also be automated with tools like <a href="https://github.com/capistrano/capistrano" rel="nofollow">Capistrano</a> and the <a href="https://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension" rel="nofollow">multistage extension</a>.</p> <p><strong>EDIT in response to your comment:</strong></p> <p>In a serious project that you are not just doing for yourself, <strong>you should never update the files that are currently deployed</strong>. Here is the proposed setup:</p> <ol> <li>Have a bare git repository - either accessible on your server or on github.com (or any other provider)</li> <li>Clone the repository on your development machine - this is the code you'll be working on</li> <li>Suppose a change in the beta branch: push that change</li> <li>Now you can clone your beta branch of the bare repository into your deployment path for beta</li> <li>Whenever you feel ready: pull beta into master (on your dev machine)</li> <li>Push master</li> <li>Deploy master by cloning bare repository master branch into deployment path for master</li> </ol> <p>As noted above, tools like capistrano make deployment dead simple and they can even keep a history of your different deployments. Look at <a href="http://www.davegardner.me.uk/blog/2012/02/13/php-deployment-with-capistrano/" rel="nofollow">this post</a> for example to see how it is used for PHP deployments.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload