配置 git

git程序包含客户端服务端两个程序,作为开发者基本不用接触服务端配置,所以这里只介绍客户端配置。

配置文件:

  • /etc/gitconfig 全局配置
  • ~/.gitconfig~/.config/git/config 用户配置
  • /path/to/project/.git/config 项目配置

与npm配置命令相似,git也有配置命令git config,推荐使用git config -e命令编辑配置文件:

  • git config -e --system 编辑全局配置文件
  • git config -e --global 编辑用户配置文件
  • git config -e 编辑当前项目配置文件

我的配置

;;;;
; 全局配置
;;;;
[core]
  editor=vim 

;;;;
; 用户配置
;;;;
[user]
  name = 张家泳
  email = [email protected]

;;;;
; 项目配置
;;;;
[core]
  autocrlf=true

你可能感兴趣的:(配置 git)