git config --global # 修改當(dāng)前用戶的配置
sudo git config --system # 修改系統(tǒng)全局的配置
git config --list
user.email=mtide@xxx.com
user.name=mtide
core.ignorecase=false
core.autocrlf=input
core.filemode=false
core.safecrlf=true
core.editor=vim
core.repositoryformatversion=0
core.bare=false
core.logallrefupdates=true
core.precomposeunicode=true
push.default=simple
alias.lg=log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
pull.rebase=true
git config 解析
user.email=mtide@xxx.com
user.name=mtide
core.ignorecase=false # 不許忽略文件名大小寫(xiě)
core.autocrlf=input # 換行模式為 input袭灯,即提交時(shí)轉(zhuǎn)換為L(zhǎng)F,檢出時(shí)不轉(zhuǎn)換
core.filemode=false # 不檢查文件權(quán)限
core.safecrlf=true # 拒絕提交包含混合換行符的文件
core.editor=vim
core.repositoryformatversion=0 # Internal variable identifying the repository format and layout version
core.bare=false # 默認(rèn)不創(chuàng)建裸倉(cāng)庫(kù)
core.logallrefupdates=true # log 所有 ref 的更新
core.precomposeunicode=true # Mac專(zhuān)用選項(xiàng)裕循,開(kāi)啟以便文件名兼容其他系統(tǒng)
push.default=simple # 只推送本地當(dāng)前分支,且與上游分支名字一致
alias.lg=log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
pull.rebase=true # 強(qiáng)制開(kāi)啟 rebase 模式
git config 配置樣例
git config --global user.email “mtide@xxx.com"
git config --global user.name=mtide
sudo git config --system core.ignorecase false
sudo git config --system core.autocrlf input
sudo git config --system core.filemode false
sudo git config --system core.safecrlf true
sudo git config --system core.editor vim
sudo git config --system core.repositoryformatversion 0
sudo git config --system core.bare false
sudo git config --system core.logallrefupdates true
sudo git config --system core.precomposeunicode true
sudo git config --system push.default simple
sudo git config --system alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
sudo git config --system pull.rebase true