Using various VCS repositories in PhpStorm


    When deploying projects based on modular applications (for example, Magento), you are faced with the fact that the code coexists in the project located in different repositories. PhpStorm does a pretty good job of this. Suppose we have a main project located on Github that uses one new module located in the same place and one legacy module located in the SVN repository:

    The git submodules mechanism allows working simultaneously with several git repositories , and PhpStorm also allows you to add an SVN repository to this.

    We form a project

    We clone the main project, in which there are no submodules yet, on the local disk:
    git clone
    cd .\z_git_submodules_main
    # добавляем субмодули
    git submodule add modules/mod01

    Something like this appears in the .gitmodules file:
    [submodule "modules/mod_git"]
    	path = modules/mod_git
    	url =

    When cloning a main project in which git submodules are already connected, you need to additionally initiate them:
    git submodule init
    git submodule update

    Removing a submodule
    Based on :
    git submodule deinit -f modules/mod01
    git rm -f  modules/mod01

    Separately connect the SVN module:
    svn co modules/mod_svn

    You should get something like this file structure:

    Configure PhpStorm

    We specify in PhpStrom settings all mount points of repositories in our project:

    Work with changes

    We make changes to the README files in each of the modules and in the project itself (three files in total):

    Commit changes to the repository:

    For git repositories, push changes additionally:

    Check changes in all repositories:

    Thus, we have the opportunity to commit our changes to several repositories at a time.

    Local code update:

    Also popular now: