Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h3>GIT_WORK_TREE</h3> <p>It's the same as using <a href="http://schacon.github.com/git/git.html" rel="nofollow"><code>--work-tree</code></a> with the <code>git</code> command.</p> <blockquote> <p><code>--work-tree=&lt;path&gt;</code></p> <p>Set the path to the working tree. It can be an absolute path or a path relative to the current working directory. This can also be controlled by setting the GIT_WORK_TREE environment variable and the core.worktree configuration variable (see core.worktree in git-config(1) for a more detailed discussion).</p> </blockquote> <hr> <h3>Bare Repository</h3> <p>You can only push to bare repositories. So he does the following:</p> <ol> <li>Create a bare repository where you will push to. Store it somewhere like in <code>/home/git/repos/www.example.org</code> (on the server).</li> <li>Clone that repository into another folder like <code>/var/www/www.example.org</code> (on the server).</li> <li><p>Point your Apache/httpd to the non-bare repo location.</p> <pre><code>DocumentRoot /var/www/www.example.org DocumentRoot /var/www/www.example.org/public # for Rails apps </code></pre></li> <li><p>Add a post-receive hook (<code>hooks/post-receive</code>, chmod +x) to the bare repo, which checks out the bare repository when a push is received (i.e. use <code>GIT_WORK_TREE=/var/www/www.example.org</code>). (Note: If you have to reload/restart your server (Ruby apps for example) add something like <code>service SERVICE_NAME restart</code> to the hook script as well.)</p></li> <li><p>Push from your development machine to the bare repo. The bare repo will now automatically "forward" that push to the repository residing in <code>/var/www/www.example.org</code>. The unison of <em>githooks</em> and Magic<sup>TM</sup> has now updated your code, you should see changes if you F5 in your browser.</p></li> </ol>
 

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