<p>Is it possible to check out subdirectories of a repository in Git?</p>

<p>Imagine I am setting up a new WordPress installation. I will create two new directories for my plugin and theme customization:</p>

<ul>
<li><code>wordpress/wp-content/plugins/myplugins/</code> </li>
<li><code>wordpress/wp-content/themes/mytheme/</code></li>
</ul>

<p>I want to maintain these directories via Git. In Subversion, I would accomplish this by having <code>trunk/myplugins/</code> and <code>trunk/mytheme/</code> directories and checking out subdirectories. Does Git have a way to accomplish the same task using a single repository?</p>

<p>I could just be missing the boat on some Git paradigm, as a long time SVN user with little exposure to Git.</p>

<p><strong>Edit:</strong> <a href="https://stackoverflow.com/questions/466303/git-branches-with-completely-different-content">Multiple branches</a> storing different content is an interesting way to handle this.</p>

There is no real way to do that in git. And if you won’t be making changes that affect both trees at once as a single work unit, there is no good reason to use a single repository for both. I thought I would miss this Subversion feature, but I found that creating repositories has so little administrative mental overhead (simply due to the fact that repositories are stored right next to their working copy, rather than requiring me to explicitly pick some place outside of the working copy) that I got used to just making lots of small single-purpose repositories.
If you insist (or really need it), though, you could make a git repository with just
```
mytheme
```
and
```
myplugins
```
directories and symlink those from within the WordPress install.
MDCore wrote:
making a commit to, e.g.,
mytheme
will increment the revision number for
myplugin
Note that this is not a concern for git, if you do decide to put both directories in a single repository, because git does away entirely with the concept of monotonically increasing revision numbers of any form.
The sole criterion for what things to put together in a single  repository in git is whether it constitutes a single unit, ie. in your case whether there are changes where it does not make sense to look at the edits in each directory in isolation. If you have changes where you need to edit files in both directories at once and the edits belong together, they should be one repository. If not, then don’t glom them together.
Git really really wants you to use separate repositories for separate entities.
submodules
Submodules do not address the desire to keep both directories in one repository, because they would actually
enforce
having a separate repository for each directory, which are then brought together in
another
repository using submodules. Worse, since the directories inside the WordPress install are not direct subdirectories of the same directory and are also part of a hierarchy with many other files, using the per-directory repositories as submodules in a unified repository would offer no benefit whatsoever, because the unified repository would not reflect any use case/need.