zoukankan      html  css  js  c++  java
  • Windows下msysGit使用及相关配置

      Windows下msysGit使用

      目前我们git通过ssh进行通信,所以需要你也安装ssh以及将ssh key发给我,省得每次都需要输入用户名和密码

      1、创建工程目录

      windows下进入msysGit目录下点击msys.bat,进入命令行

      mkdir–p /d/workspace/

      2、从版本库clone版本

      git clone git@192.168.10.49:hello.git

      3、配置本地msysGit  

      git可以针对每个git工程进行单独配置,也可以全局配置。这里我们针对单个工程进行配置

      a、进入你的工程目录
      cd /d/workspace

      b、设置你的用户名和邮件
      gitconfig --global user.name "guoyun"                       #设置姓名,这里不同于现有svn请务必设置你名字的全拼,因为姓名首字母以后有新人进来总会有重复

      gitconfig --global user.email "username@email.com"     #设置邮件

      c、设置颜色

      gitconfig --global color.diff auto           # git diff的时候要显示颜色

      gitconfig --global color.status auto       # git status的时候要显示颜色

      gitconfig --global color.branch auto     # git branch的时候要显示颜色

      d、设置命令别名
      gitconfig --system alias.st "status"        # git status命令别名为gitst

      gitconfig --system alias.ci "commit"     # git commit命令别名为git ci

      gitconfig --system alias.co "checkout"   # git checkout命令别名为git co

      gitconfig --system alias.br "branch"      # git branch命令别名为gitbr

      e、设置各种编码,避免乱码问题

      gitconfig --global core.quotepath false #文件名不乱码

      gitconfig --global gui.encoding utf-8     #gui界面编码

      gitconfig --global gui.encoding utf-8     #设置gitgui的界面编码为UTF-8

      gitconfig --global i18n.commitencoding utf-8    #设置 commit log 提交时使用 utf-8 编码

      gitconfig --global i18n.logoutputencoding utf-8 #设置git log输出日志时的编码是utf-8

      f、其他设置

      gitconfigcore.logallrefupdates        #设置分日志功能,可以找到重置后的提交。一些误操作后比较有用可以找回误操作丢失的代码

  • 相关阅读:
    清除富文本样式
    jquery--cookie应用
    Log4j 配置详解
    判断请求是否为ajax
    日期工具类
    Windows Server2012 KB2919355 补丁无法安装
    安装系统步骤:
    大白菜u盘启动盘制作工具取消赞助商方法详解
    视频使用教程
    检查网络是否正常的几种命令
  • 原文地址:https://www.cnblogs.com/candle806/p/4071419.html
Copyright © 2011-2022 走看看