Asked  4 Months ago    Answers:  5   Viewed   795 times

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

 Answers

85

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.

Saturday, July 10, 2021
 
superfell
answered 4 Months ago
19

(Original answer: June 2011)

MatrixFrog correctly points out to the bug 299315, which mentions those hooks aren't supported yet.

You also can explore the JGit repository, now on GitHub, which doesn't show any commit about hooks.
And you can search for 'hook' in the EGit User Guide: the notion of hook isn't mentioned either.


Update March 2015 (4 years later): as MariuszS points out in the comments, "hook" is present in JGit.

In 2015, there are works in progress to support those hooks:

  • "Introduce hook support into the FS implementations"
  • "Support for the pre-commit hook" (so not yet pre-receive hook)

Those should be in the upcoming JGit 3.7


Update Q4 2015, EGit 4.x does support hooks, as mentioned in this answer.

Saturday, June 26, 2021
 
tdous
answered 4 Months ago
30

By default, EGit automatically adds resources marked as "Derived" to .gitignore. A typical example is the bin folder in a Java project containing the compiled classes.

You can disable this by going to Window > Preferences > Team > Git > Projects and deselect "Automatically ignore derived resources by adding them to .gitignore".

There was also a bug in EGit where it added entries when the Eclipse model and the filesystem were out-of-sync, see bug 421610 (fixed for EGit 3.5).

Sunday, August 8, 2021
 
Maury
answered 2 Months ago
30

I think I found it, instead of "Mark as Merged", I need to do "Add"

Manual conflict resolution

To resolve a conflict you have to do the following steps:

Navigate to the conflicting resource Edit the content of the conflicting resource Tell EGit that the conflict is resolved with Team -> Add

Commit the conflict resolution with Team > Commit

from http://wiki.eclipse.org/EGit/User_Guide#Manual_conflict_resolution

Edit: apparently, I should have learned git command line before playing with EGit, same concept there

Sunday, August 15, 2021
 
Gishantha Darshana
answered 2 Months ago
43

You have to work with the History view instead of with the Git Reflog view (see git reflog and toniedzwiedz's answer for details):

  1. Tell the History view which history should be shown: e. g. in Git Repositories view right-click a repository and choose: Show In > History.
  2. In the History view enable the option Show All Branches and Tags (right button in the view toolbar). Otherwise, only commits of the current branch are displayed.
Thursday, September 2, 2021
 
Andrew Stakhov
answered 2 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :