生而为人

程序员的自我修养

0%

问题解决

[toc]

网络问题

github 网址访问不了

GitHub打不开的解决方案(超简单)

  1. https://sites.ipaddress.com/github.com/
  2. https://sites.ipaddress.com/fastly.net/
  3. https://sites.ipaddress.com/assets-cdn.github.com/

My IP | IP Address Tools | IP Geolocation | Website Traffic Checker

1
2
3
4
5
6
7
8
9
140.82.114.4 github.com
151.101.1.194 github.global.ssl.fastly.net
151.101.65.194 github.global.ssl.fastly.net
151.101.129.194 github.global.ssl.fastly.net
151.101.193.194 github.global.ssl.fastly.net
185.199.108.153 assets-cdn.github.com
185.199.109.153 assets-cdn.github.com
185.199.110.153 assets-cdn.github.com
185.199.111.153 assets-cdn.github.com

Mac:

1
2
3
4
sudo vi /etc/hosts

# 刷新DNS
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Windows:

1
> ipconfig /flushdns

配置问题

权限问题

The RSA host key for github.com has changed

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for github.com has changed,
and the key for the corresponding IP address 20.205.243.166
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s.
Please contact your system administrator.
Add correct host key in /Users/cjq/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/cjq/.ssh/known_hosts:10
RSA host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
1
2
3
>> ssh-keygen -R github.com			//更新know_hosts中的内容
>> 更新publickey(参考)
>> ssh -T git@github.com // 测试是否能正确连接

问题

LF will be replaced by CRLF

1
2
3
4
git config core.autocrlf false
1. true:
2. false:
3. input:

切换分支时 如何保证文件完全与线上一致,即其他分支新加的文件被删掉

命令报错

Author identity unknown

报错信息

1
2
3
4
5
6
7
8
9
10
11
12
13
Author identity unknown

*** Please tell me who you are.

Run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'jingqi@DESKTOP-BKUPVT9.(none)')

解决办法

  1. 按照指导重新设置user.email和user.name,注意变量名称不要设置错了
  2. 用git var GIT_AUTHOR_IDENT 验证是否设置成功。

参考资料:

  1. git config doc
  2. Configuring Git to handle line endings
  3. https://blog.csdn.net/helloasimo/article/details/123778112