6
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

俺の.gitconfigを晒す!

Last updated at Posted at 2018-12-26

目的

 別環境で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情報の発信していますので、よろしくお願いします。

6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?