slider

还是菜鸟
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

egit - not authorized

Posted on 2013-12-20 23:54  slider  阅读(567)  评论(0编辑  收藏  举报

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.