Disable git branch
filter by less
git config --global pager.branch false
Search File Contains Both Pattern in Current Work Directory
git grep --all-match -l --no-index -e 'pattern1' -e 'pattern2'
--all-match
means that a file must contains pattern1
and pattern2
.
-l
means list matched files instead of lines
--no-index
only searches current working-set, history not searched.
The confusing part is --or
, --and
work for single line, not the whole file,
--all-match
works on whole file.
网友评论