文章目录
- 1、Git报错解决:fatal: unable to access ‘https://github.com/.......‘: OpenSSL SSL_read: Connection was reset
- 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
- 3、Already up to date
- 4、error: src refspec develop does not match any.error: failed to push some refs to 'https://******'
- 5、fatal: refusing to merge unrelated histories
- 6、git不识别中文的解决方法
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 编码