1.
ERROR: You're using an RSA key with SHA-1, which is no longer allowed.
Please use a newer client or a different key type
解决方法:
2.
fatal: Not a git repository (or any of the parent directories): .git
解决方法:需要初始化
git init
3.
remote: Permission to xxxxxx/mygit.git denied to xxxxxx
fatal: unable to access 'https://ghp _yY7NeIMPW4LVEJEuqvt0hvNid2ulXY4LcSla@github.com/xxxxxx/mygit.git/': The reguested URl returned error: 403
解决方法:需要生成令牌
4.
error: failed to push some refs to 'https://xxxxxxxxxxxxxx@github.com/xxxxxx/mygit.git/'
解决方法:
git pull --rebase origin master
5.
克隆时出现报错:
fatal: unable to access 'https://github.com/xxxxxx/mygit.git/': Unknown SSL protocol error int connection to github.com port 443: Timed out
git config http.sslVerify "false"
6.
fatal: unable to access 'http://zzzz/xxxxx/xx_core.git/': Failed to connect to 127.0.0.1 port 10809: connection refused
解决方法:
查询是否使用代理:git config --global http.proxy
取消代理:git config --global --unset http.proxy
7.
在Git中,从服务器克隆文件到本地可以使用两种不同的URL格式:HTTP和SSH。
(1)使用HTTP URL克隆:当使用以http://开头的URL进行克隆时,Git会通过HTTP协议与服务器进行通信。这种方式通常不需要额外的配置,适用于大多数情况。 你可以使用以下命令进行克隆:git clone http://xxxx/xxxxx.git
(2)使用SSH URL克隆: 当使用以git@开头的URL进行克隆时,Git会通过SSH协议与服务器进行通信。这种方式需要配置SSH密钥,以便进行身份验证。
如果你使用SSH URL克隆失败,可能是由于以下原因:
1. 没有正确配置SSH密钥。
2. SSH密钥权限不正确。
3. 服务器未配置正确的SSH访问权限。
要解决这个问题,你可以按照以下步骤进行操作:
1. 确保你已经生成了SSH密钥对,并将公钥添加到你的Git服务器账户中。
2. 检查SSH密钥的权限是否正确设置为600(只有所有者可读写)。
3. 确保服务器上的SSH配置正确,允许使用SSH协议进行访问。
如果你仍然遇到问题,可以尝试以下方法:
1. 检查你的网络连接是否正常,确保能够访问服务器。
2. 检查服务器的SSH配置是否正确,例如是否启用了SSH访问。
3. 尝试使用其他SSH客户端或工具进行克隆,以确定是否是Git本身的问题。