I am importing a git project into Eclipse using a git URL. It is giving me the below errors in a popup.
Incorrect URL
No Network Connection (wrong proxy connection)
SSH is not configured correctly.
I have checked that the URL is correct. How to check the remaining 2 options?
Try testing each error-message suggestion one by one:
Confirm the URL again. Never hurts.
Connect to the host machine (or website) where your repo lives from outside of Eclipse. If you can't do this, your connection to the host is probably the issue. If you can, the issue is not with your connection.
Clone the git repo to your machine directly: open a command prompt, navigate to a temporary folder, and git clone <URL>, where is the SSH address you have confirmed. If the repo clones successfully, SSH is working fine on your machine, and it's time to look at Eclipse, and the information you're passing it.
If you provide more information on your environment, network configuration (esp. re: proxies, as #howlger suggests), SSH configuration, and the settings you are passing to Eclipse, the community may be better able to assist with your specific case.
Related
I am unable to clone a repository in Eclipse. But yes I am able to clone the same through git bash.
I am getting an error with possible reasons as:
Incorrect URL
No network connection
SSH is not configured properly.
My URL is correct and I am having proper network connection, though. As far as SSH is concerned, I am having the same set of keys in my local Windows folder, Eclipse > SSH2 and my Gerrit SSH public keys.
I am really confused, that where I am missing out on this.
The issue was due to SSH keys. I generated the new pair of keys from eclipse and mapped it to Gerrit. It is working for me now.
Thanks Rudiger for your help.
I discovered an OSS project I've contributed to had moved to github. I installed hg-git and cloned a local repo from the git:// URL; then I made changes.
I then realized I really wanted my own github fork, so I made one; but I haven't been able to figure out quite how to switch my existing local repo. I've changed the local repo settings to use the git:// URL of my fork, and it can pull; but I can't push my changes up. It tells me to use the https:// URL, but when I make that change, I can neither pull nor push -- I get an error 406, "not acceptable."
The work done in the local repo is minimal, so I can redo it, but it'd be simpler if the local repo and my fork could just connect now.
UPDATE
I've installed Github for Windows so I could manage the SSH key. It generated a key (github_rsa) and attached it to my Github account.
I edited the hgrc file and added a [ui]ssh= setting pointing to the local git 'ssh' command (buried down in %APPDATA%\Local\Github).
With this, if I go into a "git-shell" window, which I guess spawns ssh-agent, then I can enter commands such as "hg incoming" and the connection is made. So I've got the remote repo URL right, and within the git-shell ecosystem, I've got the SSH keys set up right.
From a regular CMD.EXE window, the same command yields "Permission denied (publickey)". From TortoiseHg, the same error appears when I try an "incoming" action. I'd prefer to keep using TortoiseHg, but I'm not sure how to get it to use SSH.
FINAL UPDATE
For some reason, TortoisePlink doesn't want to play with github's SSH server, at least not with the Github-for-Windows-generated key. So I still have Github for Windows installed (not necessarily a bad thing, but superfluous to what I wanted to do).
To get hg and TortoiseHg to connect, I had to modify my project settings:
[ui]
ssh = %USERPROFILE%\AppData\Local\GitHub\<salt>\bin\ssh -i %USERPROFILE%\.ssh\github_rsa
That is: point to the SSH command, installed with portable GitHub, and specify the github-generated key on the command line. With this configuration, I don't need ssh-agent to be running.
You need to push via ssh, meaning you need to push via:
hg push git+ssh://git#github.com/<login>/<repo>
Note the usage of git# instead of your login in the first part of the URL. This actually matters; the server will figure out your credentials via the supplied SSH key.
You may also have to add your ssh key to your GitHub account first (per step 4 of this page).
This assumes that you created a fork of the original GitHub repository via the GitHub UI; pushing to an empty repository with hg-git may require additional steps.
Our shared server account at godaddy comes preinstalled with git version 1.7.1. I've set up a bare repository following this strategy,
http://git-scm.com/book/en/Git-on-the-Server-Getting-Git-on-a-Server
When I attempt to push via ssh in egit in eclipse I get this error,
Can't connect to any URI: ssh://url:22/git-test/test.git
(ssh://url:22/git-test/test.git: connection failed)
And yet using the same authentication in Putty I have no problem.
What I eventually want to do is to set up a git repository on the godaddy account that will permit development of the website from a few remote locations and then permit a push to production-live.
There is no git-daemon available, but apparently it isn't needed according to the above link.
This could be a problem with server configuration or remote setup on the egit side.
Make sure you are suing the full path of your repo
git remote set-url origin ssh://username#domain.com/home/username/path/git-test/test.git
(with test.git being a bare repo, with a post-receive hook to update the live site)
Try it from the command line first (no need for putty), then change your remote url on Eclipse/EGit.
You don't need to specify the port number (22 being the default one for ssh).
For me the problem was firewall by the VPN i used. By disabling the VPN Eclipse could push.
I don't seem to be able to connect to a Github private repo with Eclipse.
I am able to connect to the repo through the command line on windows by using mysysgit with putty (Pageant), without the need to provide login/password. Is use this article and it works LINKE.
Eclipse does recognize my git repo, but when I right click and pull/push, nothing really happens: it's says it's pulling 0% in the eclipse status bar, but it doesn't change...
I have added the ssh private/pub key to the eclipse pref I followed the helpful links in this post, but not having a lot of luck.
When adding the github repo through the import and searching, I do get the error shown in the screenshot :
And when I add the private repo through the Eclipse import uri, I get also an error, see screenshot (using git protocol):
I also tried the https protocol, but then get the following error:
I tried many things as you can find these errors with Google, but didn't manage to solve it :(
I am using putty Pageant, and that works on the command line. But in the github help I read that github doesn't work with Putty, but in my case it does :(...
Any idea how to solve this?
EDITED:
I just noticed that a pull request does work, but it take like 10 min to end, while it costs 10s on the command line. Any idea?
Regarding ssh, you would need to configure Egit in order to show where your pubic/private keys are: Eclipse SSH Configuration
If you are using plink/pagent keys (instead of openssh ones), see "Using putty's pagent with egit in Eclipse".
Regarding https, many causes can prevent to access a remote repo: anti-virus, JVM, certificates issue, ...
My (newest) Netbeans (NetBeans IDE 7.3 (Build 201302132200)) seems to be failing completely, when I'm trying to access my own GitHub repo using SSH. It works without problems with HTTP URLs.
Since I've imported an existing local copy of GitHub repository (New > PHP Project with existing sources), created once with TortoiseGit, there were remote settings saved in local copy meta-data (probably in .git folder). So Netbeans offers option Select Configured Git Repository Location in Push to Remote Repository window. But is unsuccessful at that.
Tried following:
When I'm using SSH URL (git#github.com:user/reponame.git) and Password option, with account pass, Netbeans tries to connect GitHub (remote) and after circa 5 seconds throws error Cannot connect to the remote repository at git#github.com:user/reponame.git.
When using SSH URL with Private/Public Key option, Netbeans throws exactly the same error immediately, so I assume, that for some reason it doesn't even tries to connect GitHub.
What is even more strange (?), Netbeans is not asking for private key's passpharse. I've set it, but did not entered it to Netbeans deliberately, to test connection process. I was more than sure, that Netbeans will ask me to provide this passpharse, as it shouldn't be able to use private key without it. To my surprise, it hasn't asked for it and instead it thrown an error saying, that it can't connect GitHub. Of course, that was only a test. After entering correct passpharse, I'm getting exactly the same effects.
I've copied my repo's URL directly from GitHub website, without any modifications. It seems, that I can only use HTTP URL (https://github.com/user/reponame.git). This works and assures me that all items (URL, user, reponame, password, finally Internet connection) are OK. But, it seems, that Netbeans fails completely on SSH URL.
Above happens always, no matter if I select Select Configured Git Repository Location or Specify Git Repository Location in Push to Remote Repository window. No matter, what I'll do I can't access my repository via SSH in Netbeans and using HTTP is the only option.
I have created my private-public key pair using puttygen.exe from PuTTY's website. I saved private key in Netbeans installation directory and added public key to GitHub's SSH Settings page. I used step-by-step guide I normally use with TortoiseGit.
I don't know what else I could miss out or I'm doing wrong? Any idea?
For the record:
When generating keys with PuTTYgen, it's recommended for compatibility to export it as an OpenSSH key. This can be achieved by accesing Conversions > Export OpenSSH key menu.
After series of many tests, I found out that Netbeans:
Does not work to well with existing local copies of GitHub (or any other git) remote repositories.
Does not work at all with SSH keys generated by puttygen.
As for first, I had to remove entire folder cloned with TortoiseGit and clone the same repository using Netbeans-bundled tools (Team > Git > Clone). The same goes for Subversion (look here) -- so the general rule of thumb says, that when you're switching from another Git or SVN client to Netbeans, you should do a full, clean clone (or checkout) of remote repository as attempts to re-use existing copy will most likely fail.
As for second, follow instructions given in this GitHub article and use ssh-keygen (either from your local installation of Git for Windows, in case of Windows or from any other source) instead of puttygen -- SSH keys generated by it can't be used in Netbeans for setting up password-less login to GitHub.
As I wrote, I've been using TortoiseGit previously, which accepts and works well with puttygen keys, so it wasn't to obvious for me, that source of the problem is here.
After fixing this two problems (getting clean clone and generating correct keys), ale problems expressed in my question were gone and Netbeans works with GitHub repositories like a charm.
My solution was to use a the ssh-keygen with the PEM option:
ssh-keygen -t rsa -b 4096 -m PEM -C my#mail.xy
Netbeans 12 use JGit for the Git-tool and this supports only special kinds of ssh keys?