git 问题记录

1.git代码拉取报错

SSH配置问题

Warning: the ECDSA host key for 'slave2' differs from the key for the IP address '219.244.48.xxx'
Offending key for IP in /home/hadoop/.ssh/known_hosts:3
Matching host key in /home/hadoop/.ssh/known_hosts:8

解决办法:

ssh-keygen -R 219.244.48.xxx //报错的IP

2.将git http方式替换为ssh

git config --global url."git@gitlab.xxx.com:".insteadof "https://gitlab.xxx.com/"
原文地址:https://www.cnblogs.com/tomtellyou/p/12837490.html