目录
  1. 1. Windows 使用Git时出现: warning: LF will be replaced by CRLF
  2. 2. 如何解决The authenticity of host ‘github.com (52.74.223.119)’ can’t be established.
Git使用过程中出现的错误

记录在使用GitHub时遇到的问题

Windows 使用Git时出现: warning: LF will be replaced by CRLF

问题如下:

解决方法:

Windows中的换行符为CRLF, 而在Linux下的换行符为LF,所以在执行git add . 时会出现提示

jboss-cli
1
rm -rf .git //删除.git
2
git config --global core.autocrlf false //禁用自动转换

然后重新执行

dockerfile
1
git init
2
git add .

就不会再出现这个问题。

如何解决The authenticity of host ‘github.com (52.74.223.119)’ can’t be established.

在github上建立仓库,进行git clone时报错:

powershell
1
The authenticity of host 'github.com (52.74.223.119)' can't be established.
2
RSA key fingerprint is SHA256: nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
3
Are you sure you want to continue connecting (yes/no)?
4
Host key verification failed.
5
Fatal: Could not read from remote repository.
6
7
Please make sure you have the correct access rights
8
And the repository exists.

Google后发现,是少了一个know_hosts文件,本来密钥文件应该是三个,现在是两个,便报了这样的错误,此时选择yes回车后,便可,同时生成缺少的known_hosts文件:

livescript
1
Are you sure you want to continue connecting (yes/no)? //输入yes,回车
文章作者: Izzio
文章链接: https://izzio.netlify.com/blog/git/64352.html
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Seventy
ENG