title: How to properly manage a git repo in a subdirectory, ignored by the parent directory, as its own project?
body: <p>I am looking to use <a href="http://www.vagrantup.com/">Vagrant</a> for a development project for <a href="http://laravel.com/">laravel</a>. To facilitate this effort, I am using this github project, <a href="https://github.com/bryannielsen/Laravel4-Vagrant">Laravel4-Vagrant</a>. </p>
  
  <p>The vagrant configuration is managed as a git repository. Part of the Vagrant setup has a per-defined <code>www</code> directory which gets mapped to <code>/var/www</code> once the server is setup so you can just work with files inside the guest vm from the host vm directly. However, within <a href="https://github.com/bryannielsen/Laravel4-Vagrant/tree/master/www">this www</a> directory there is a <code>.gitignore</code> file. This makes a lot of sense because you want to manage your vagrant setup and start from scratch with your app development, etc.</p>
  
  <p>However, you start doing your application development and have your project sitting in this <code>www</code> directory. It would be nice to also manage this project in git, then you could deploy your app to another web server or a new vagrant installation. Because of the <code>.gitignore</code> file there is no way to use git on the files in this directory since the parent wants to ignore it.</p>
  
  <p>I am not sure if git-submodules is the right solution here or some other special configuration.</p>
  
  <hr>
  
  <p>More generically:</p>
  
  <p>How can I create a git repo for a project, which ignores a child directory, but the files within that child directory (which are ignored by the parent) are managed at their own git repo?</p>
  
  <p>Ideally, I should be able to package the parent up and the child up separately.</p>
  
  <p>Would appreciate some generic explanation and some specific help to setup the project listed above as the example. </p>
  
  <hr>
  
  <p>Edits:</p>
  
  <p>There is no real requirement for structure, etc as long as the two projects can be maintained in separate repos and can either be deployed together or one their own (e.g., I can use my custom vagrant built to setup another dev/prod environment or I can deploy the laravel project to an existing deployment elsewhere). I would also consider other standard source version control systems that easily work together. Also, would it make a difference if the initial laravel repo was installed via git? using the template github project cited above, it does not clone a git repo for the initial install but uses the laravel installer.</p>