# 常见问题

# 1、如何解决设置 ssh 密钥后仍然会被要求从 github 输入密码?

您的本地 repo 配置仍在使用 http 机制,您需要将其切换到 ssh 机制。

站在本地副本的主文件夹中,编辑.git/config文件(用vim .git/config或者用你喜欢的编辑器)

在标记 [remote "origin"] 下,您将看到 url 属性。它应该指向您的存储库的 http 引用。

注释或删除该行并将 URL 切换为指向 ssh 引用,如下所示:

[remote "origin"]
   url = git@github.com:user/repo.git
   #url = https://github.com/user/repo.git
1
2
3

# 2、OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443问题解决

多次尝试之后发现是代理的问题,所以执行命令,禁用代理配置即可(因为我使用的是https请求,所以取消https代理即可):

git --config --unset https.proxy
1

# 3、在新版本 v2.40.0.windows.1 提示 To add an exception for this directory, call:

fatal: detected dubious ownership in repository at 'D:/my-project'
'D:/my-project' is owned by:
         'S-1-5-21-3960057471-3692628222-638656427-500'
but the current user is:
         'S-1-5-21-3960057471-3692628222-638656427-500'
To add an exception for this directory, call:

         git config --global --add safe.directory D:/my-project
1
2
3
4
5
6
7
8

解决办法:

# 根据提示设置目录
git config --global --add safe.directory D:/my-project
# 设置所有目录
git config --global --add safe.directory "*"
1
2
3
4
上次更新: 3/25/2023, 8:26:51 AM