Skip to content

Instantly share code, notes, and snippets.

@oksuz
Created July 26, 2018 08:33
Show Gist options
  • Save oksuz/c68a47f00262887f2b281c44707d30e0 to your computer and use it in GitHub Desktop.
Save oksuz/c68a47f00262887f2b281c44707d30e0 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Searchs $FILE's $TEXT changes in all branches
# Author: Yunus Oksuz <yunusoksuz@gmail.com>
# track all remote branches
git branch -a | grep -v HEAD | perl -ne 'chomp($_); s|^\*?\s*||; if (m|(.+)/(.+)| && not $d{$2}) {print qq(git branch --track $2 $1/$2\n)} else {$d{$_}=1}' | csh -xfs
TEXT="1\\.8\\.76"
FILE="build.gradle"
for i in `git branch | grep -v master`;
do
git checkout ${i}
git --no-pager log --follow -p $FILE | grep $TEXT
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment