Include submodules into Git repository

Including third-party repository in your project may be make with Git submodule tools.
Command:
git submodule add git://github.com/gitaccount/repository.git your_diructory_submodule
Need be add info about submodules for your IDE. For JetBrains (Intelejia, PHPStorm, etc): Settings - Version Control - Add (Choise option Directory and set your catalog with submodule).
Use branch for your submodules, because after commit in main repository you can lost your changes.
Window in IntelliJ IDE for push commit look that:
Repository on Github looks like:
Sources:
- Official documentation about Submodules tools
- Sample my submodules repository on Github - ModuleRepoMain