Home > Software engineering >  Connect to an existing Git repository in IntelliJ IDEA
Connect to an existing Git repository in IntelliJ IDEA

Time:06-07

This is NOT a duplicate of Import an existing Git repository into IntelliJ IDEA, because I am trying to connect an existing non-empty project to an existing non-empty repository. The title says it all, any ideas?

CodePudding user response:

Try first in command-line, before switching to Git.

cd /path/to/local/repository
git remote add origin https://url/existing/remote/repository
git fetch
git log --decorate --oneline --graph --all --branches

If you see the same history for origin/main and your local main branch, you have the right remote repository.

Then open IntelliJ IDEA, which should detect the newly added remote origin reference.
(Check VCS -> Git -> Remotes)

  • Related