git程序包含客戶端和服務(wù)端兩個程序,作為開發(fā)者基本不用接觸服務(wù)端配置,所以這里只介紹客戶端配置。
配置文件:
-
/etc/gitconfig全局配置 -
~/.gitconfig或~/.config/git/config用戶配置 -
/path/to/project/.git/config項(xiàng)目配置
與npm配置命令相似,git也有配置命令
git config,推薦使用git config -e命令編輯配置文件:
-
git config -e --system編輯全局配置文件 -
git config -e --global編輯用戶配置文件 -
git config -e編輯當(dāng)前項(xiàng)目配置文件
我的配置
;;;;
; 全局配置
;;;;
[core]
editor=vim
;;;;
; 用戶配置
;;;;
[user]
name = 張家泳
email = daifee@daifee.com
;;;;
; 項(xiàng)目配置
;;;;
[core]
autocrlf=true