顯示具有 git 標籤的文章。 顯示所有文章
顯示具有 git 標籤的文章。 顯示所有文章

2016-03-14

調整的 git diff 的 meta color

首先要讓 git diff 有顏色

    git config --global color.ui true

底下的設定可以讓所謂的 meta (程式碼以外的註解) 具有不同顏色

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

以上的 blue, black 兩個位置分別代表字體和背景的顏色
可以填的值有 normal, black, red, green, yellow, blue, magenta, cyan, or white

而最後一個 bold 的位置代表字的 style
可以填的值有 bold, dim, ul (underline), blink, and reverse (swap foreground and background)ㄎ

--
參考資料
https://git-scm.com/book/zh-tw/v2/Customizing-Git-Git-Configuration#Colors-in-Git

oh-my-zsh 預設的 git plugin

自從 bash 有一陣子 security 接連出問題之後,
我給了 z-shell 一次機會,而 oh-my-zsh 很快的就成為我的好朋友
不過直到最近才注意到 .zshrc 裡面的預設的

    plugins=(git)

提供的 git alias 還挺方便的,可以省去很多打字的麻煩

可以用

    alias | grep git 

來查看全部

順便紀錄當中幾個比較好用的縮寫有

  • git status 相關
    • gst
      • git status
    • gss
      • git status -sb
  • git diff 相關
    • gd
      • git diff
    • gdca
      • git diff --cached
  • git log 相關
    • glg
      • git log --stat --color
    • glgp
      • git log --stat --color -p
    • glol
      • git log --oneline --decorate --color --graph

深夜驚醒, 不知道是哪一句歌 先穿過夢的縫隙。 紅磨坊仍在唱, 燈火那麼紅, 愛情那麼盛大, 像所有年輕時相信的事—— 只要足夠用力, 就能抵抗離別。 於是我想起高中那年, 和那年同行的女孩並肩坐在黑暗裡, 銀幕亮著, 她的側臉也亮著。 那時候不知道, 有些電影散場以後, 人也會...