Different repositories for each module in intellij IDEA

后端 未结 3 1473
一向
一向 2021-02-04 05:08

I\'m not sure how to select a different git repo for each different module I have in my IDEA project, I\'m not seeing any option for that, all the git options seem to only relat

3条回答
  •  一向
    一向 (楼主)
    2021-02-04 05:47

    Okay I think I cracked this one for my circumstance anyway... very confusing as there doesn't seem to be specific instructions on how to set this up anywhere. I have a project that houses an Angular-CLI client-side app and a Grails API server-side app.

    So if you are trying to set up CVS using GIT for a multi-moduled project and want to use a separate git repository for each module, not the entire project, then....

    1. Add additional roots by File > Settings > Version Control >
    2. Click the '+' symbol > browse to the project root and select the module folder > OK > VCS: select Git > OK
    3. Repeat step 2 for all other modules
    4. Once all modules are add that you wish to commit to individual repositories > click the settings OK
    5. YES, YES, you will immediately be alerted with a 'VCS root mapping' error!!!
    6. Don't panic. Select the module from the Intellij 'Project/Solution' browser.
    7. Right-click > select Git > Commit Directory > Unversioned Files click the 'browse' link and select the module directory and click the green '+' icon.
    8. You will be warned that that the module is already under Git control but go ahead and add it anyway.
    9. Repeat steps 7-9 for all other modules.
    10. This will remove the 'VCS root mapping' error.
    11. Now go to your version control window which should be located a the bottom of the Intellij application window. There should be an unversioned folder > expand > and you will see all modules listed here.
    12. Add each of the modules by clicking the '+' button... again???!!! :-)
    13. Right-click the default tree and select 'commit and push'.
    14. This will commit all the modules to the local VCS Git
    15. Once the commit has completed a dialogue 'Push Commits' will appear where you will see that each module has an open to add your remote repo url for each module!!!!
    16. Yey!!!!

    Hope this is helpful for all :-)

提交回复
热议问题