Add Module to git(hub) without using eclipse?

Answered

Actions taken:

  • created a new empty IDEA  project
  • imported some modules from different github repos.
  • create a new module (Spring Boot template).

Desire:

  • Add the new module to a new github repo

I reviewed the following - but it does not uncover how to add the new module to git. VCS / add ... seems to want to push the entire project into git (i tried and it works), but i am only wanting to add the module.

- https://www.jetbrains.com/help/idea/associating-a-directory-with-a-specific-version-control-system.html

So far- my alternative is to use eclipse/sts to create the module (eclipse project) - add to git - then import as a module in IDEA. I would like to stay completely in the IDEA tool if possible. Suggestions/alternative workflows are appreciated as I create large numbers of reference projects used by other developers.

Thanks,

Peter

 

0
5 comments

The Help topic you referenced describes how to map a folder that already is under version control.

Your new module is not under version control, so you first need to put it under git. To do this, you could use VCS - Import into Version control - Create Git Repository.

This will put the desired module in a separate git repo, which you could then pus to GitHub, or another git remote. This can be done from IDEA also - go to VCS - GIt - Remotes to add a remote, and then VCS - Git - Push (or Ctrl+Shift+K)

 

0
Avatar
Permanently deleted user

Will give this a try - thanks Dmitriy. I am REALLY liking some of the flows available with Spring Boot in the 2017.3 rc release. The code navigation in from Spring Boot thymeleaf templates to rest APIs is VERY nice. One item I am not sure about - I like the new run dashboard very much - but it seems run dashboard does not appear under view / tool windows until after you have run something once? eg. new project / new boot module - no view/tool/run dashboard?

New Spring boot / mvc integration is VERY much appreciated. I have been using STS/eclipse for many years - so this makes for a very familiar flow (although - generally - IDEA has fare broader integration)

I have a pretty extensive set of projects under: https://github.com/csap-platform/csap-core/wiki that are pretty comprehensive Java 8 / Spring Boot samples. So far no issues.

0

Yes, Run tool window/Dashboard appears only after something is run.

0
Avatar
Permanently deleted user

Thanks again for your responses. I was able to get this working as shown below.

When using the VCS-GIT-Remotes dialog - it seems you must create the remote first as an empty repo at github. Ideally, the workflow would be:

  1. create boot module using IDEA wizard
  2. VCS -  add module to github (using module name)

The current working method:

  1. Using browser: create a repo at github
  2. Using IDEA: create boot module
  3. Using IDEA - create a repo using  VCS- import - create
  4. Using IDEA - define git location using VCS- git - remotes (paste in url)
  5. Using IDEA - push to remote

 

0

There is a separate action Share on GitHub that actually combines actions 1, 3,4 and 5, but it works for the entire project only, unfortunately.

There is a request to add the same for a module - https://youtrack.jetbrains.com/issue/IDEA-67488

0

Please sign in to leave a comment.