配置Git客戶端

  • 系統:讀/etc/gitconfig 該文件。(傳遞 --system 選項)
  • 全局:查找每個用戶的 ~/.gitconfig 文件(或者 ~/.config/git/config 文件)。(傳遞 --global 選項)
  • 本地:查找工程Git 目錄下的配置文件(.git/config)。 這個文件中的值只對該版本庫有效。

以上三個層次中每層的配置(系統、全局、本地)都會覆蓋掉上一層次的配置,所以 .git/config 中的值會覆蓋掉 /etc/gitconfig 中所對應的值。

1,設置你的名字和郵件地址

$ git config --global user.name "John Doe"
$ git config --global user.email [email protected]

2,設置你的默認的編輯器

$ git config --global core.editor vim

3,設置Git 中的着色與字體屬性

$ git config --global color.ui auto

  color.branch 、color.diff 、color.interactive 、color.status 定製着色爲 normalblackredgreenyellowbluemagentacyanwhite。字體屬性的話,可以選擇包括:bolddimul(下劃線)、blinkreverse(交換前景色和背景色)。

$ git config --global color.diff.meta "blue black bold"

 

發佈了71 篇原創文章 · 獲贊 10 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章