把所有本地分支包含某个字符的行列出来,把含有master的列出来
git branch|sed 's/*/ /g'|xargs -i git grep -n master {}

shell的写法:

#!/bin/bash

a=$(git branch|sed 's/*/ /g')

for i in ${a}
do
    git grep -n master $i
done


-n:把含有这个字符串所在的行数显示出来

 
 

相关文章:

  • 2021-07-20
  • 2022-12-23
  • 2021-11-30
  • 2021-11-20
猜你喜欢
  • 2021-08-25
  • 2022-12-23
  • 2021-04-09
  • 2022-12-23
  • 2021-11-20
  • 2021-11-20
相关资源
相似解决方案