git程序包含客戶端和服務端兩個程序,作為開發(fā)者基本不用接觸服務端配置冯勉,所以這里只介紹客戶端配置咽扇。
配置文件:
-
/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 = daifee@daifee.com
;;;;
; 項目配置
;;;;
[core]
autocrlf=true