简体   繁体   中英

IntelliJ VCS is combining projects on GitHub

Every project I now create in IntelliJ is getting mixed up with a previous one when I try to push it to GitHub. They all end up in a single repo. I was previously able to share the projects and commit and push without problem. Now, something has changed and I don't know how to fix it.

I created a new project checkGitPush to trace the problem and find the following issues. “Enable Version Control” did not show up on the VCS menu. I can commit locally, but when I try to Share the Project to GitHub, I get this message:

Project is Already on GitHub
Following remotes are already on GitHub

(It then lists three separate projects)

When I look on GitHub, all these projects are getting put into the bottom-most project listed on the message.

Any suggestions are appreciated. I am on a Windows laptop with IntellJ IDEA Community Edition 2019.2

Make sure there is no.git folder in any parent directory of the one you are using for your new project:

c:\
  path\
    to\
      .git
      some\
        new_project\

Here new_project would be part of the Git repository located in C:\path\to , and possibly linked to a GitHub repo: type git remote -v in command line to confirm it.

Removing that .git\ folder (or at least moving it, saving it elsewhere) would allow you to create an independent project, which could be linked to its own GitHub repository, following for example " CheatSheet - Setup Github on Visual Studio Code "

Looks like you create new projects inside an existing git repository. So IDE detects there is a git root above the project and registers it. As a result, new files become part of the existing repository.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM