git常用命令

  • git init # 初始化本地git仓库(创建新仓库)
  • git config --global user.name "xxx" # 配置用户名
  • git config --global user.email "xxx@xxx.com" # 配置邮件
  • git config --global color.ui true # git status等命令自动着色
  • git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库
  • git status # 查看当前版本状态(是否修改)
  • git add xyz # 添加xyz文件至index
  • git add . # 增加当前子目录下所有更改过的文件至index
  • git commit -m 'xxx' # 提交
  • git branch # 显示本地分支
  • git checkout [branch] # 检出分支
  • git push # 把所有commit推送到远程仓库

git命令图谱

git工作流程

字符编码设置

  • 设置git gui的界面编码
    -- git config --global gui.encoding utf-8
    -- git config --global i18n.commitencoding utf-8
    -- git config --global core.quotepath false
  • 设置log编码
    -- commitencoding = utf-8

本文完