28

Facing this error while committing code from Eclipse to Github

Hi,

I am facing the issue 'Can't connect to any URI:....' while committing code to Github from Eclipse. I have also generated SSH keys for my machine and added to the Github account. Please help me out...

Thanks!

OsamaA
  • 451
  • 1
  • 8
  • 13
  • Judging by the message, Eclipse is not trying to access Github via SSH. It's using the https URL. You need to change the authentication method somewhere in the settings or use a login and password configuration if HTTPS is okay for you. – toniedzwiedz May 24 '15 at 09:21

9 Answers9

42

To resolve this issue, do the followings

  1. login to your GitHub account
  2. go to https://github.com/settings/tokens
  3. click on "Generate new token"
  4. make necessary selections (but must select repo)
  5. click on "save"
  6. System will have a token
  7. use this token instead of a password in the eclipse or other tools you are using
  8. Now push your code from Github and it will work.

Thanks

B Banik
  • 425
  • 4
  • 3
  • 2
    As of August 13, 2021, you no longer have the option of using a password, as per github notice: "Beginning August 13, 2021, we will no longer accept account passwords when authenticating Git operations on GitHub.com" You can read more about this here: https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ – chars Jan 19 '22 at 22:04
9

I faced the same issue while migrating my project from github to bitbucket and this is how I resolved it:

Introduction: I will describe the ssh key usage here. A user generates a unique key to connect to remote machines using ssh. So you can create it locally. After, user uploads the keys to the remote machines where want to connect without password and more securely. On Git, the same thing happens, user creates a ssh key and uploads the generated key value to the git system providers like Github or Birbucket. After uploading your unique key, you must configure your development environment to let your git system provider communicate providing security over ssh key.

1) I was using ssh key to push my commits to remote with github in eclipse, the ssh key is set at window -> preferences -> General -> Network Connections -> SSH2 for eclipse (on git pushes, this ssh key is used if set). If you do not have any ssh keys on your machine then follow this article to generate one for you and set it into eclipse at the path above.

2) In your github or bitbucke account, find the screen where you can save your ssh key. For bitbucket, it is at https://bitbucket.org/account/user/[user-name]/ssh-keys/. '[user-name]' here is your user name at bitbucket. Open your 'id_dsa.pub' file (where you generated your ssh key) with a text editor, select all, copy and paste into your github/bitbucket accounts' ssh key addition section and then click add.

3) At eclipse, be sure to use the 'ssh' GIT URI for your project. Go to Window -> Preferences -> Team -> Git -> Configuration, click 'Repository Settings' tab and paste your GIT ssh URI to remote.origin.url.

Bitbucket ssh uri selection

4) Finally try to push your commits to remote. You mustn't face any errors, if you have please comment under my answer.

Regards...

Bahadir Tasdemir
  • 10,325
  • 4
  • 49
  • 61
5

In your Eclipse Editor, Right click on your project -> Team -> Remote -> Configure Push to Upstream

Once the window opens, click "change..." button. Now you'll get a window called 'Select a URI'.

In the authentication part, Enter your GitHub username and DO NOT Enter your GitHub password. For this, you need to create a 'personal access token' from Github. And ENTER the 'personal access token' instead of your GitHub password, in order to connect the repository.

Please refer to the following websites for a better understanding:

sruju333
  • 59
  • 1
  • 2
2

If you have generate ssh keys, then you should use an ssh url

git@github.com:user/repo

If you keep using https, then you need to enter in Eclipse your username and GitHub password: see "egit - not authorized".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

I faced the same issue but its got resolved now by generating and passing the access token as password while connecting with the local repo of eclipse.

for reference:-https://www.youtube.com/watch?v=lMQmTcBmq-U (this video is pretty helpful),hope it helps.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 09 '22 at 02:20
1
  1. Navigate to https://github.com/settings/tokens
  2. Under personal access tokens Select Tokens classic
  3. Click on Generate new token.
  4. Select the required options.
  5. Then click on generate token

Copy this token and paste it in the authentication prompt where its asking for user name and password.

For user name put your github user name and under password use the newly generated Classic token and commit the code..

Hope this helps !!!! :)

0

This can be associated with BitBucket (example) problem. Be patient and wait for them to solve this issue. If it worked before for you it will work again as soon as they fix the problem.

I.R.1989
  • 77
  • 1
  • 6
0

I faced with the same issue, but my problem solved by the below steps I changed the setting then it is worked for me Go to Window -> Preferences -> General -> Network Connections in Active Provider select Native option

0

Just Create a personal Access token and use it instead of password. If you are wondering how you create that, then please checkout the link below .Just Click here

Debayan
  • 459
  • 4
  • 6