Question

I have 2 repositories at github: 1st is for a cURL library, 2nd is for a project I'm writing. I'm trying to add my library as submodule to my project:

cd /www/fifa14api/CI-FIFA14-API/
git submodule add git@github.com:ctepeo/CI-cURL.git

My project based on CodeIgniter, so file structure looks like

/application/
/system/
index.php

My library at repo have prepared for CodeIgniter structure:

/application/
     /libraries/
         curl.php

When I add submodule, I want to "merge" them (to put my curl.php at right directory in project), but it creates CI-cURL (repo name) folder at root, so I got

/application/
/system/
/CI-cURL/
    /application/
        curl.php
index.php

How can I (and is it possible?) to exclude repository's name when adding submodule?

Was it helpful?

Solution

Git submodules are fully-fledged git repositories, so you can't check out just part of a git repo using submodules: it needs to have its own folder. You can, however, name that folder whatever you like: git submodule add git@hostname:location.git path/to/module clones the submodule to path/to/module in your git repo.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top