git関連のメモ

  • ログを見やすくする
git log --graph --all --format="%x09%an%x09%h %d %s"
  • コミット間のファイル一覧取得
git diff --stat --name-only [コミットID] [コミットID]

name-onlyをつけるとファイル名のみ取得できる

  • マージする方法
git merge [ブランチ名]

特定のファイルをマージするとき
git checkout ${branch} ${file}
  • 差分確認
git diff HEAD^ --color-words

color-words →単語に色を付ける

  • 変更を戻す場合
git checkout  data/batch/mail/BAT_01_01/mail_ok_zero.txt
  • ブランチ削除する場合
git branch --delete foo
  • コミット改行を含める方法
#-mは複数つけることができる
git commit -m "abc" -m "edf" -m "hij"