常见Git问题收集整理

129 阅读1分钟

日志中文乱码

  • git log 中文乱码
echo $LANG;
## 输出结果为空,执行下面即可解决
export LANG="zh_CN.UTF-8"

日志日期格式

  • git log 日期格式
git config log.date iso 
git config log.date format:'%Y-%m-%d %H:%M:%S'

git config --global log.date iso
git config --global log.date format:'%Y-%m-%d %H:%M:%S'

推送到多个仓库

  • git push 到多个仓库
## 使用 git remote set-url 命令
git remote set-url --add origin https://gitee.com/iszmxw/GoRbacApiService.git

## 查看效果
git remote -v
origin  https://github.com/iszmxw/GoRbacApiService.git (fetch)
origin  https://github.com/iszmxw/GoRbacApiService.git (push)
origin  https://gitee.com/iszmxw/GoRbacApiService.git (push)


记住密码

git config --global credential.helper store

本文使用 文章同步助手 同步