Created
October 1, 2012 10:46
-
-
Save tmr111116/3810894 to your computer and use it in GitHub Desktop.
git で、特定のファイルにあったキーワードがどのコミットで消されたかを調べるコマンド。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 全コミットのチェックサムと、キーワードが削除が表示されるので、キーワードの削除の上の行を見たらどのコミットかわかる。 | |
git log --follow --patch ファイルのパス | grep -E '^commit|^-.*キーワード' | |
# --follow : ファイル名の変更を追跡する。 | |
# --patch : パッチの形式でファイルの差分を表示する。 | |
# grep -E : | をそのまま使いたいので。 | |
# ^commit : どのコミットかわかるように commit で始まる行を表示する。 | |
# ^-.* : 削除だけが見たいので - で始まる行だけを表示する。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
なんかもっといい方法ないですかね…。