Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ファイルに 2 行追加したとしますhello.rb。
hello.rb
# this is a comment puts "hello world"
するとgit diff、2行追加したことが表示されます。
git diff
Rubyコメントである行をgitに表示させたくありません。を使用してみgit diff -G <regular expression>ましたが、うまくいきませんでした。git diffRuby コメントを表示しないようにするにはどうすればよいですか?
git diff -G <regular expression>
Git は、与えられたデータを非常に気にかけ、情報を失わないように懸命に努力します。Git の場合、一部の行を、変更されていたとしても変更されていないかのように扱うことは意味がありません。
これを行うための唯一の合理的な方法は、Git の出力を後処理することだと思います。