github报错解决方式合集

1、Git报错解决:fatal: unable to access ‘https://github.com/…‘: OpenSSL SSL_read: Connection was reset

解决方法:

git config --global http.sslVerify "false"
参考链接

2、error: Your local changes to the following files would be overwritten by merge: Please, commit your changes or stash them before you can merge

解决方法:

  1.git stash
  2.git pull
  3.git stash pop
参考链接

3、Already up to date

错误原因:

假定我有两个分支master和dev,当前处在dev分支。

$ git merge master
Already up to date.

Already up to date意味着已经是最新的了,即dev是在master的基础上修改的,而master自分出dev分支后就没修改过,因此dev分支是最新的,不需要于master合并,因为合并完的仓库和当前的dev分支是一模一样的。

在这里插入图片描述
解决方法:

多提交一个空的commit,使两条分支叉开,再合并。具体命令:
在这里插入图片描述

# 移动到master分支下
$ git checkout master 
# 在master提交一个空内容
$ git commit --allow-empty -m "ready for merging"
# 合并master和dev分支
$ git merge dev
# 移除dev指针(可选)
$ git branch --delete dev
参考链接

4、error: src refspec develop does not match any.error: failed to push some refs to ‘https://******’

解决方法:

git push origin 本地分支:远程分支
参考链接

5、fatal: refusing to merge unrelated histories

解决方法:

在操作命令后面加 --allow-unrelated-histories

git merge master --allow-unrelated-histories
$ git pull --allow-unrelated-histories
参考链接

6、git不识别中文的解决方法

hlp@ubuntu:~/0723/daily_notes$ git config --global core.quotepath false 
# 设置 git status utf-8编码
hlp@ubuntu:~/0723/daily_notes$ git config --global gui.encoding utf-8 
# 设置Git GUI界面utf-8编码
hlp@ubuntu:~/0723/daily_notes$ git config --global i18n.commit.encoding utf-8 
# 设置commit信息utf-8编码
hlp@ubuntu:~/0723/daily_notes$ git config --global i18n.logoutputencoding utf-8 
# 设置输出 log utf-8 编码
参考链接
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值