Problems with pushing to github repository from Eclipse: Auth fail - eclipse

I followed the steps from Egit user guide, but I get an error message with auth fail.
What I do:
I have copied the public key from Window > Preferences > Network Connections > SSH2 > Key Management to GitHub under account settings
Then I do
Team > Push...
I enter the git#github.com:.... uri and click next. But then I get the error:
**Cannot get remote repository refs
Reason: git#github.com:.... : Auth fail**
What could be the problem?
Thanks

Old question, but for future reference:
Make sure you did setup a push remote. It worked for me when I got both the Cannot get remote repository refs-problems ("... Passphrase for..." and "Auth fail" in the "Push..." dialog).
Provided that you already:
Setup your SSH keys with Github (Window > Preferences > General > Network Connections > SSH2)
Setup your local repository (you can follow this guide for that)
Created a Github repository (same guide)
... here's how you do it:
Go to the Git Repositories view (Window > Show View > Other > Git Repositories)
Expand your Repository and right click Remotes --> "Create Remote"
"Remote Name": origin, "Configure push": checked --> click "OK"
Click the "Change..." button
Paste your git URI and select protocol ssh --> click "Finish"
Now, click "Save and Push" and NOW you should get a password prompt --> enter the public key passphrase here (provided that you DID (and you should) setup a passphrase to your public key) --> click "OK"
Now you should get a confirmation window saying "Pushed to YourRepository - origin" --> click "OK"
Push to upstream, but this time use "Configured remote repository" as your Destination Git repository
Go get yourself a well earned cup of coffee!

Check my solution from this related question:
"Auth Failed" error with EGit and GitHub
Briefly: set GIT_SSH environment variable with a path to the system ssh executable before launching Eclipse. Far from nice but works.
For Ubuntu:
> export GIT_SSH=/usr/bin/ssh
> eclipse

I finally fixed this on my platform (mainly was a key issue but also critical not to have a leading slash before the repo path in the dialog pictured above). You can see more details in my post here, if you like:
http://www.eclipse.org/forums/index.php?t=msg&goto=648905&S=9bcfa96ab726d744d41a19c7fb02d723#msg_648905
Good luck!
Melissa

DO not forget to add .git to the repository name in the URI : field
for example if ur username is Decoderx and git repository name is foo
URI :https://github.com/Decoderx/foo.git
and not "https://github.com/Decoderx/foo" this solved this problem for me.

You can try and follow this tutorial, using the git+ssh protocol:
git+ssh://git#github.com/path_to/repo.git.github
Just git#github.com alone wouldn't work.

http://wiki.eclipse.org/EGit/User_Guide#Github_Tutorial

Related

"SSL host could not be verified" error

Whenever I try to connect the git via eclipse mars, I entered the bitbucket URL as the instructions in this website.
http://crunchify.com/how-to-configure-bitbucket-git-repository-in-you-eclipse/
The problem occurred in the step 9 which is in the website link. Then when I click Next, the following errors occur.
.git is missing at end of repository URL // I tried it but SSL verification error occurred again.)
SSL host could not be verified. (set http.sslVerify=false in Git configuration)
How can I solve that SSL host issue and pass to the step 10 which is the website link?
In my experience it seems that it happens under Windows with certain configuration of Eclipse (not sure which ones).
Go in Eclipse Preferences -> Team -> Git -> Configuration, and click "Add Entry..."
Put "http.sslVerify" as key and "false" as value (no quotes).
In the "clone repository" window put your user / password (don't leave "git", since there is no ssh-key configured under Windows, I suppose).
If needed, in the Git Repository view, check the properties of your new repository and double check that remote.origin.url has your username rather than "git" (otherwise during authentication you'll have a greyed out username textbox with "git" written in it).

How to use EGit with SSH on Windows?

I am trying to import a git repository from remote into Eclipse 3.6 with EGit 2.1. I have generated a new SSH key and have also added the pub_key to authorized keys on server side. But I always get the error: read time out. - After Branch selection.
When I clone the repository with same credentials from cygwin or from git bash it works very well.
Has anybody an idea?
Does Eclipse see your new ssh keys ?
To check this open "Preferences > General > Network Connections > SSH2"
in tab "General":
check if "SSH2 home" is pointing to your ~/.ssh folder
check if private key is listed, otherwise add it
in tab "Key Management" try to load the (private) key you want to use
The problem was the remote connection timeout. Increasing it, has solved the problem:
Preferences --> Team --> Git: "Remote connections timeout (seconds): 99999999

Can't push using EGit and Bitbucket

I've been trying to start a project using EGit with Bitbucket but I can't push the project to the repository in the server.
These are the steps I've followed (I'll try to be very specific so other people can use it as a tutorial mode; even though it's not working for me it might work for others):
1) I installed Git on Ubuntu 12.10 using this tutorial
2) Followed this tutorial for GitHub.
Start a new C++ project in Eclipse
Under Window > Preferences > General > Network Connection > SSH2 > Key Management tab, I generated a new RSA key and added it to the list of deployment keys of my repository on Bitbucket.
Right click on the eclipse project: Team > Share project ; Team > Add to index ; Team > Commit
Window > Show View > Other > Git > Git Repositories
Right click on Remotes > Create Remote > Checked "Configure push" and typed my project's name
Add Push URL: ssh://git#bitbucket.org/myuser/myrepository.git, Protocol: ssh; port: blank; user: git; password: blank
Advanced button under Ref mappings and selected the "master" version. If this step works, it means that the RSA key is configured in Bitbucket and EGit properly. Otherwise it will show a connection error.
Everything is done. However, when I press "Push" I get the following error:
ssh://git#bitbucket.org/myuser/myrepository.git: push not permitted
I've tried every configuration possible: switched to a new work space, updated Eclipse, created new repositories, re-installed Git... Any ideas?
Alright, I've finally found a way to work with it.
It's just changing the authentication mode. If the HTTPS link is used, instead of using the SSH link, everything works perfectly. It seems that SSH works just in a read-only mode.
Of course the authentication method is different: you have to type the password and the SSH keys stored in Bitbucket are no longer necessary.
For those who are having problems with EGit, I recommend following eugener's way to automatically configure EGit. Then you just have to select HTTPS as authentication mode to push the stored commits.
There is much simpler way of configuring remote Git repos in Eclipse:
Create an empty repo on BitBicket
Copy repo's URL
Clone repo to your machine using "Git Repositories" view.
Share your project into newly cloned repo.
Since a repo was cloned - remote settings were configured automatically. This means you will be able to push immediately
It might be a user name misconfiguration in .gitconfig.
Probably related, I fixed "auth fail" problems by following the instructions on:
http://wangpidong.blogspot.com.es/2012/05/how-to-use-bitbucket-with-egit-in.html
Got it from:
Configuring egit with BitBucket
In this specific case I agree with resolution from Olivier J.'s comment under original question.
But I have had similar problem and it was caused by something else. I resolved it and here is what happened:
I have been using some private repository at Bitbucket (A) with some user account and some public key (X) to access it. I have had key X loaded in my pageant Putty key chain.
Then I created a new public repository (B), also at Bitbucket with a different user account and another public key (Y). I added this key to pageant too.
When I tried to access repository B apparently public key X and not Y was used, because ..for SSH client both connections are the same - same user (git) at the same host (bitbucket.org)! And key X was used first because ..it was loaded earier? Or maybe because its name was alphabetically first? I am not sure but the result was that...
Read-only access for B using X was granted because the repository was public and any valid Bitbucket user key was enough to gain this kind of access!
..but writing (pushing) required key Y, which was not used by SSH.
So the general tip is: to resolve strange read-only git via SSH access errors check carefully which private key is actually used by SSH.
I resolved this problem by loading only one key - X or Y - in pageant at a time but I would love to do it a smarter way - please let me know in comments if you know how!
Using Bitbucket I do it this way:
create a repository in bitbucket
clone the empty repository using the https url
connect the project in eclipse to the repository using the Team -> Share option and select the location where you cloned the repo
index (stage) your project files
commit and push

invalid username/password in egit when pushing changes to googlecode

I have a project hosted in googlecode with Git.
I'm using STS (SpringSource Tool Suite) with eGit.
I cloned the repository at home and I could commit & push the changes successfully.
I did the same thing at work and when I try to push the changes after commiting them, it shows the following error:
https://myuser#code.google.com/p/myproject/: Invalid username/password.
You may need to use your generated googlecode.com password; see https://code.google.com/hosting/settings
I entered the googlecode generated password when I first cloned the repository (as I did at home, and this error never showed up). I try entering it again and nothing changes.
Does anyone know what could be causing this?
Thanks!!
Do as following:
Open Git repositories view, open "Remotes > origin > " and click "Change Credentials..."
Further reference: http://www.eclipse.org/forums/index.php/t/209017/
Enjoy!
I resolved it by going to Preferences > General > Security > Secure Storage > Contens tab and deleting default secure storage for repository.

Possible to Connect Netbeans with GitHub?

I know the Git integration is Netbeans 7.0 is new and under development, but has anyone had success on pushing/pulling to GitHub?
When I click Git->Push the remote repository url shows up correctly under Step 1. Configured Repository.
But is just stays stuck on " Connecting to repository". It also pops up a box saying "Specify Git repository location" with the exact same url , clicking OK does nothing.
If instead I choose "Specify Git Repository Location" I eventually get an error, "Cannot connect to the remote repository at git#github.com:username/..."
ps. I am aware of the other similar stack questions but they are confusing, one person mentions that he was able to do this, while others mention is not yet possible to use a remote Git connection.
I have had the same issue.
And now it works fine for me.
I have done this:
1 With CLI ( Terminal for me) Define your remote repo :
cd yourlocalfolder
git remote add origin git#github.com:username/repo.git
2 Open Netbeans (7.1 for me)
Go to Team > Git > Remote > Push
3 You should see your remote repo preselected
4 in Private /public key browse to your rsa file
usr/username/ssh/id_rsa
5 Click on Next
6 Done
You need check 'Specify Git Repository Location:'
'Repository URL:' https://github.com/<your username>/<yourGitFile>.git
'User:' <your username>
But is just stays stuck on " Connecting to repository". It also pops up a box saying "Specify Git repository location" with the exact same url , clicking OK does nothing.
I faced the exact same issue and after I did some research I found that the problem was with the password.
GitHub isn’t accepting passwords for Git operations anymore.
So instead of using a password, Github suggests using Personal Access Token.
Go to your Github account settings.
Go to Developer settings in the sidebar.
Go to Personal access tokens.
Generate new token.
Make sure to check repo scope checkbox to access your repositories.
After you get your access token you can copy it and past it in the password field in the "Specify Git repository location" window and try to push your project.