Git错误问题解决集合

在实际的生产过程中,使用git时难免会遇到各种各样的错误,然后去寻找解决答案,所以就想为什么不把我遇到的问题直接写出来集合在一起呢?既方便自己也方便别人

错误1:fatal: HttpRequestException encountered

在「push」代码的时候,即使是先「拉去」代码到本地也是会出现


原因:Github 禁用了TLS v1.0 and v1.1

解决:更新Windows的git凭证管理器

https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.14.0


Updates were rejected because the tip of your current branch is behind

「push」代码过程时,发生报错行为


解决方法:

1.强制「push」

git push -u origin master -f

2.先拉去远程仓库代码在进行 「push」

git pull origin master
git push -u origin master

参考:

https://blog.csdn.net/txy864/article/details/79557729
https://blog.csdn.net/michael10001/article/details/51371715

猜你喜欢

转载自blog.csdn.net/qq_32135281/article/details/80581867
今日推荐