二、Git 问题汇总及处理
- git commit 中文编码乱码问题
处理:设置 Git 支持 utf-8 编码
文章链接: http://howiefh.github.io/2014/10/11/git-encoding/
$ git config --global core.quotepath false # 显示 status 编码
$ git config --global gui.encoding utf-8 # 图形界面编码
$ git config --global i18n.commit.encoding utf-8 # 提交信息编码
$ git config --global i18n.logoutputencoding utf-8 # 输出 log 编码
$ export LESSCHARSET=utf-8
# 最后一条命令是因为 git log 默认使用 less 分页,所以需要 bash 对 less 命令进行 utf-8 编码
- ssh: Could not resolve hostname git: Name or service not known fatal: Could not read from remote repository. 问题
遇到这个问题是我个人github上没先新建新的版本库,然后就先在项目上自己手动添加远程版本库命令
git remote add origin git@github.com:mrsmallyi/laravel-shop.git
可能是手敲命令问题导致,后面到GitHub上添加新版本库后,重新复制添加远程版本可的两条命令就可以了git remote add origin git@github.com:mrsmallyi/laravel-shop.git git push -u origin master
本作品采用《CC 协议》,转载必须注明作者和本文链接
下载最新版 git 可以提交中文的