配置


分两种:

  1. 全局配置
  2. 项目内配置

查看全部信息

BASH
        1git config --list
      

配置代理

全局

BASH
        1git config --global http.proxy http://127.0.0.1:<端口号>
2git config --global https.proxy http://127.0.0.1:<端口号>
      

取消

BASH
        1git config --global --unset http.proxy
2git config --global --unset https.proxy
      

配置用户信息


全局

  1. 查看全局

    BASH
            1git config --global user.name
    2git config --global user.email
          
  2. 配置全局

    BASH
            1git config --global user.name "<用户名>"
    2git config --global user.email "<用户邮箱>"
          
  3. 取消全局配置

    BASH
            1git config --global --unset user.name
    2git config --global --unset user.email
          

项目内配置

BASH
        1git config user.name "<用户名>"
2git config user.email "<用户邮箱>"
      

配置换行转换

warning: in the working copy of '<路径/文件>', LF will be replaced by CRLF the next time Git touches it

文件编码为utf-8或者utf-8-unix时,使用LF(Linux/macOS换行符)。

在Windows上提交,Git会将其转换为CRLF(Windows换行符)并给出提醒。

全局关闭转换

BASH
        1git config --global core.autocrlf false
      
标题目录