How to add a git submodule?

Answered

How can I add a git submodule to a Pycharm project within Pycharm? (I know how to do it from the git CLI, but it would be much smoother if I could do it from within Pycharm).
Thx,
Beat

0
4 comments

Hello Beat Ludin

If you mean that you've created a folder in a folder and you would like to run 'git init' in this folder, then you can press Shift two times -> type "Create Git repository" and choose desired folder.
Also, if you have some submodule, please make sure it's listed as registered under Preferences | Version Control.

0

Hi Ruslan Kuleshov
Thanks for your answer. What I want to do is to add an existing repo from Github as submodule to a project. Basically, what I would do from the command line with git submodule add <some-repo-url>

0

Thank you for clarification Beat Ludin

There is no action for "git submodule add" in IDE. There was a feature request for it, please see:
https://youtrack.jetbrains.com/issue/IDEA-208577

0

Once you do it from CLI, you can add it to PyCharm's Version Control here: `Version Control > Directory Mappings`

5

Please sign in to leave a comment.