Providing custom files for git submodule

My project uses Varying-Vagrant-Vagrants as a submodule in /machine.

VVV offers the possibility to configure it through custom files. My custom files are:

  • How could I use git to deploy?
  • Findbugs for Git Pull Request
  • How can I manually run the hook post-receive on git?
  • Untrack git file
  • Remove/hide git branches without deleting commit histories
  • Is there library of git for android
  • machine/
    ├── Customfile
    ├── config
    │   └── nginx-config
    │       └── sites
    │           └── mysite.conf
    └── www
        └── mysite
            ├── vvv-hosts
            └── wp-cli.yml

    These paths are all ignored in VVV’s .gitignore file.

    What’s a good way of providing these files in my project so that they sit in the same directory as vvv when the whole project is recursively cloned? Hopefully without having to make a fork that tracks these files.

    Simply adding the submodule with these files present has the following result:

    $ git submodule add machine/
    'machine' already exists and is not a valid git repo


  • Checkout from non-working branch and want to rebase to master
  • `git blame/annotate`: terminate on merge commits
  • Git parameter pipeline script
  • Git clone not working with npm
  • Only trigger builds on new branches in Jenkins?
  • Version controlling laravel. Which files should i ignore?
  • One Solution collect form web for “Providing custom files for git submodule”

    From git help submodule,

    Submodules allow foreign repositories to be embedded within a dedicated
    subdirectory of the source tree, always pointed at a particular commit.

    Your invocation of git submodule add is complaining because you are trying to embed the foreign VVV repository in the subdirectory machine, which, as the message said, already exists and is not a valid git repo.

    To get your desired directory structure, with machine as a subdirectory of the VVV directory, you’d have to have your repo as a submodule of theirs, not the other way around.

    Given that, I don’t see how you could get a single git clone to pull both repos and organize them as you’d like. Next best might be to have your repo pull the VVV repo as a submodule/subdirectory parallel to your machine directory and include a script to establish a symlink to machine from inside the VVV subdirectory.

    Git Baby is a git and github fan, let's start git clone.