4
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

posted at

updated at

俺の.gitconfigを晒す!

目的

 別環境でgitの省略コマンド使うときにコピペしたいので、ついでに晒して情報発信してみる。

.gitconfig

[user]
        name = XXXX
        email = XXXX@example.com
[color]
  # colorの設定(以下のコマンドは自動で色つける)
  status = auto
  diff = auto
  branch = auto
  interactive = auto
  grep = auto
  ui = auto

[alias]

  # いい感じのグラフでログを表示
  graph = log --graph --date=short --decorate=short --pretty=format:'%Cgreen%h %Creset%cd %Cblue%cn %Cred%d %Creset%s'

  # 上の省略形
  gr = log --graph --date=short --decorate=short --pretty=format:'%Cgreen%h %Creset%cd %Cblue%cn %Cred%d %Creset%s'
  st = status
  ss = status -s
  cm = commit

  # Untracked filesを表示せず,not stagedと,stagedだけの状態を出力する
  stt = status -uno

  # 行ごとの差分じゃなくて,単語レベルでの差分を色付きで表示する
  df = diff --color-words
  dc = diff --cached
  dp = diff --no-prefix
  d1 = diff HEAD~            # HEADから1つ前とdiff
  d2 = diff HEAD~~           # HEADから2つ前とdiff
  d3 = diff HEAD~~~          # HEADから3つ前とdiff
  co = checkout
  br = branch
  ad = add

最後に

自分はの.gitconfigのほうが便利だ!っていう方はコメント欄に晒してください。良さそうならパクります!

自分の技術ブログではフリーランス界隈の情報や最新のIT情報の発信していますので、よろしくお願いします。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
4
Help us understand the problem. What are the problem?