gpt4 book ai didi

windows - ssh和GIT : couldn't resolve hostname

转载 作者:行者123 更新时间:2023-12-02 14:34:51 26 4
gpt4 key购买 nike

使用Win7,Gitolite和TortoiseGIT

今天,我将GIT更新为2.6.1版,因此必须卸载旧版本。
很久以前,我创建了一个ssh-config文件,以更轻松地访问我的存储库,并且从今天开始一切运行良好。

更新之后,我尝试克隆一个现有的存储库,并出现以下错误:

ssh: couldn't resolve hostname gitbox: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

在我看来,像GIT一样不知道ssh-config文件位于何处。

以下提供了帮助,但是我对该解决方案并不满意:
  • 启动GIT GUI
  • 尝试克隆存储库->与
  • 之前相同的错误
  • 发现GIT在/c/Users/newUser/
  • 中创建了一个新文件夹
  • 我发现.gitconfig文件夹内
  • 在此处创建.ssh文件夹
  • 在此处复制rsa key 和配置文件
  • 以前一样工作

  • 有人可以解释这里发生了什么吗?或者如何告诉GIT/ssh我的配置文件最初位于何处?

    非常感谢你!

    最佳答案

    Can someone explain what happened here?



    您需要确保将HOME正确设置为 %USERPROFILE%:默认情况下,git将在 .ssh中查找全局配置和 %HOME%设置。

    默认情况下,调用 c:\path\to\PortableGit-2.6.1-64-bit\git-cmd.exe将启动正确设置HOME的CMD session 。
    在bash session 中, c:\path\to\PortableGit-2.6.1-64-bit\git-bash.exe将对 $HOME做相同的操作。

    关于windows - ssh和GIT : couldn't resolve hostname,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32971678/

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