gpt4 book ai didi

eclipse - egit - 未授权

转载 作者:IT王子 更新时间:2023-10-29 00:48:02 26 4
gpt4 key购买 nike

我刚刚使用 EGit 从 Eclipse Juno 连接到 GIT,并成功克隆了某个远程存储库。在克隆过程中,我输入了我的 Github 用户名和密码,但选择不保存它们。

然后我尝试“从上游获取”。我收到此错误:

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

我没有机会输入我的用户名和密码...

这很奇怪,因为我连接到这个存储库是为了克隆...

最佳答案

2022 年更新:在接下来的内容中,始终使用:


一个。为每个远程单独指定凭据

  1. 打开 Git 存储库 View ,
  2. 打开“Remotes > origin > <your push url>
  3. 点击“更改凭据...”

push menu

(来自User Guide - Resource Context Menu)

B.为每个服务器指定凭据

如果您想访问同一台服务器上的多个存储库而无需多次提供相同的凭据,您可以使用 .netrc。这样,eGit 将使用您提供的配置。

  1. 创建一个名为 .netrc 的文本文件(在 Windows 中为 _netrc)在用户主目录中。
  2. 以这种形式向文件添加内容:
    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.


More secure option (2022): EGit (from issue 441198) can be made (with an extension) to recognize a native Git credential helper, using a secure encrypted cache:

  • install a native Git

  • install the GCM (Git Credential Manager), which is cross-platform, and already package with Git For Windows for instance.

  • instruct EGit to look for credentials in the GCM: gitflow-incremental-builder/gitflow-incremental-builder

  • register your password or token in said GCM

    printf "Host=my.server1.com\nprotocol=https\nusername=yourUsername1\npassword=passwd1" | \
    git credential-manager-core store
    # and:
    printf "Host=my.server1.com\nprotocol=https\nusername=yourUsername1\npassword=passwd1" | \
    git credential-manager-core store

寻找可执行文件 git-credential-manager-core , 并将其文件夹添加到您的 %PATH%/$PATH .

关于eclipse - egit - 未授权,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14259265/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com