How to checkout git repo subdirectory into current directory? : <p>There is a remote repo with directory structure:</p>

<pre><code>-directory1
    -file1_1
    -file1_2
    ...
-directory2
    -file2_1
    -file2_2
    ...
</code></pre>

<p>I have a folder on a web hosting with a custom name, say, "/path/public_html".</p>

<p>How do I set up git on the web hosting, so my "public_html" tracks a subdirectory "directory2" of a remote repo?</p>

<p>So, in other words, I want to execute some form of git command on the web hosting and update public_html to the latest content of "directory2". I don't care about pushing back to repo from web hosting, if it helps.</p>
