Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't connect to any URI error while commiting code from Eclipse to Git Repository

Tags:

github

eclipse

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!

like image 993
OsamaA Avatar asked May 24 '15 09:05

OsamaA


People also ask

Can't connect to any URI error while commiting code from Eclipse to Git repository?

Go to Window -> Preferences -> Team -> Git -> Configuration , click ' Repository Settings ' tab and paste your GIT ssh URI to remote. origin. url . 4) Finally try to push your commits to remote.


2 Answers

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

like image 175
Bablu Banik Avatar answered Sep 21 '22 14:09

Bablu Banik


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...

like image 24
Bahadir Tasdemir Avatar answered Sep 23 '22 14:09

Bahadir Tasdemir