开发者

Scanning for patterns in files modified under git

开发者 https://www.devze.com 2022-12-07 22:14 出处:网络
How do you scan for patterns on changed lines within a git repo? I\'m trying to find the pattern "<<<<<<<" in all files locally modified.

How do you scan for patterns on changed lines within a git repo?

I'm trying to find the pattern "<<<<<<<" in all files locally modified.

To do this I thought I'd output git's diff, which should show all changed lines, and then just do a grep, like:

git diff --diff-filter=d origin/master | grep -B 5 -A 5 '<<<<<<<'

However, instead of outputting a diff, this launches my meld (on U开发者_开发百科buntu), my local git difftool. How do I stop it from launching meld and make it simply output a diff?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号