Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

egit - not authorized

Tags:

git

eclipse

egit

I just connected to GIT from Eclipse Juno using EGit, and successfully cloned a certain remote repository. During the clone I entered my Github username and password, but chose not to save them.

Then I tried to "Fetch from Upstream". I got this error:

https://github.com/biunlp/nlp-lab.git: not authorized

I had no chance of entering my username and password...

This is strange since I connected to this repository in order to clone...

like image 813
Erel Segal-Halevi Avatar asked Jan 10 '13 13:01

Erel Segal-Halevi


People also ask

How do I authorize Git in Eclipse?

Open your eclipse ide and navigate to Help -> Install New Software. After that click on Add and enter eGit on Name and https://download.eclipse.org/egit/updates/ in the Location. Then select all checkboxes as shown below and click next. After that accept the terms & conditions and click finish.

What is EGit policy?

EGit is an Eclipse Team provider for the Git version control system. Git is a distributed SCM, which means every developer has a full copy of all history of every revision of the code, making queries against the history very fast and versatile.

Can't connect to any repository while pushing to GitHub?

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


2 Answers

A. To specify credentials individually for each remote

  1. Open Git repositories view,
  2. open "Remotes > origin > <your push url>"
  3. click "Change Credentials..."

push menu

(From User Guide - Resource Context Menu)

B. To specify credentials per server

If you want to access multiple repositories on the same server without providing the same credentials multiple times, you may use .netrc. With this, eGit will use the configuration you provide.

  1. Create a text file called .netrc (_netrc in Windows) in the user home directory.
  2. Add content to the file in this form:
     machine my.server1.com     login yourUserName     password yourPassword      machine my.server2.com     login yourUserName     password yourPassword 

The Stash documentation contains more information about .netrc

Security issue The problem with using .netrc this way is that the password is visible in plain text. Refer to this answer in Stackoverflow to solve that problem.

like image 155
VonC Avatar answered Sep 20 '22 10:09

VonC


You can try:

eclipse/myeclipse > menu

window > preferences > general > security >

content > click "delete" > ok

like image 42
qingshan Avatar answered Sep 20 '22 10:09

qingshan