“Invalid remote: origin” error when importing to Eclipse (m2eclipse, eGit)

In Eclipse when I try to import a project from a repository (File > Import > Maven > Check out Maven Projects from SCM) I select ‘git‘ (eGit installed), fill in the ssh://… address (all the keys and access permissions are set), finally type in the password for rsa and…

Invalid remote: origin: Invalid remote: origin

According to this: http://youtrack.jetbrains.com/issue/IDEA-77239 writing .git at the end of address should solve the problem but actually it does not.

  • using github + eclipse to pull code
  • Importing projects in a BitBucket repository into Eclipse
  • No repository found containing: osgi.bundle and org.eclipse.update.feature
  • EGit Push: How to store the remote repository info
  • Why is eclipse trying to copy my .svn folders from src to bin, and how can I make it stop?
  • calling cryptdb from eclipse java project
  • I have totally no idea how to resolve it further. Any ideas?

    Edit: And I use Windows. It seems like an important piece of information to add.

  • undoing a pull from the wrong github repository
  • Why does git clean -dX not remove my ignored directory?
  • OSX Using Beyond Compare as git difftool
  • Adding SSH-key through curl: Fingerprint cannot be generated
  • git push unexpected behavior with 2 remotes
  • Unexpected merge error in a git svn system?
  • 3 Solutions collect form web for ““Invalid remote: origin” error when importing to Eclipse (m2eclipse, eGit)”

    This error can occur when there is an underlying SSH authentication issue, like having the wrong public key on the git remote server or if the git remote server changed its SSH host key.

    Eclipse will use the .ssh directory you specify in Preferences -> General -> Network Connections -> SSH2 for its ssh configuration. Set it “{your default user directory}.ssh\” .

    To fix things, first you need to determine which ssh client you are using for Git. This is stored in the GIT_SSH environmental variable. Right-click on “Computer” (Windows 7), then choose Properties -> Advanced System Settings -> Environment Variables.

    If GIT_SSH contains a path to plink.exe, you are using the PuTTY stack.

    • To get your public key, open PuTTYgen.exe and then load your private key file (*.ppk). The listed public key should match the public key on the git remote server.
    • To get the new host key, open a new PuTTY.exe session, and then connect to git@{git repo host}.
    • Click OK and say yes to store the new key.
    • Once you get a login prompt, you can close the PuTTY window. The new key has been stored.
    • Restart Eclipse.

    If GIT_SSH contains a path to “ssh.exe” in your “Git for Windows” tree, you are using Git for Windows’s OpenSSH.

    • Set %HOME% to your default user directory (as listed in Eclipse; see above).
    • Set %HOMEDRIVE% to the drive letter of your default user directory.
    • Set %HOMEPATH% to the path to your default user directory on %HOMEDRIVE%
    • To get your public key, open the file %HOMEDRIVE%%HOMEPATH%/.ssh/id_rsa.pub (or id_dsa.pub) in a text editor. The listed public key should match the public key on the git remote server.
    • To get the new host key, run: cmd.exe
    • Run Git Bash
    • Ctrl-C
    • At the bash prompt, run /c/path/to/git/for/windows/bin/ssh.exe git@{git remote host}.
    • Type yes to accept the new key.
    • Once you have a login prompt, type: ctrl-c
    • Close the cmd.exe window
    • Restart Eclipse.

    Finally, if you are still having trouble with your external ssh client, delete the GIT_SSH environmental variable and set the HOME environmental variable to your default user directory on Windows. Without the GIT_SSH variable, EGit will use its internal ssh client (java). It will use the .ssh directory you specified above as its SSH configuration directory.

    Note: If you have Git for Windows, you can use its tools to create a SSH key pair your .ssh directory:

    • Set %HOME% to your default user directory (as listed in Eclipse).
    • Set %HOMEDRIVE% to the drive letter of your default user directory.
    • Set %HOMEPATH% to the path to your default user directory on %HOMEDRIVE%
    • Run Git Bash
    • Ctrl -C
    • Run: ssh-keygen.exe -t rsa -b 2048
    • Save to the default filenames
    • Choose a passphrase or save without one. If you save with a passphrase, Eclipse will prompt you for it each time you push or pull from your git remote server.
    • Close Git Bash

    You can also use the GUI in the SSH2 Preference pane in Eclipse to manage hosts and keys.

    Using Eclipse / Indigo, with the Maven plugin:
    -Check out Maven Projects from SCM
    -assuming that the git SCM plugin is installed, select “git” from the SCM URL: popup
    -enter, e.g., https://@github.com//.git
    having @ and “.git” is important
    -assuming that the project is private, you will be prompted for the password
    This should be good enough to move forward.

    check out your .git/config this error can occur is your missing “.git” at the end of your origin url

    [remote “origin”]
    url = https://some.domain.com/repo/name

    should be

    [remote “origin”]
    url = https://some.domain.com/repo/name.git

    Git Baby is a git and github fan, let's start git clone.