Skip to content

Instantly share code, notes, and snippets.

@renkin
Last active January 19, 2022 15:55
Show Gist options
  • Save renkin/c814a5a68c183488b6c3a48defd43c63 to your computer and use it in GitHub Desktop.
Save renkin/c814a5a68c183488b6c3a48defd43c63 to your computer and use it in GitHub Desktop.
This script greps for a branch name in all relevant repos.
#!/bin/bash
#
# This script greps for a branch name in all relevant repos.
#
# Usage: grep_branchname_in_git_repos.sh <branch name>
# E.g.: grep_branchname_in_git_repos.sh 8.2.2
#
RELEVANT_REPOS=( repo1 repo2 )
# base directory, where all repositories are located
BASE_DIR="/c/Dev/FP"
BRANCH_NAME="$1"
for repo in "${RELEVANT_REPOS[@]}"
do
echo ""
echo "Repo '$repo'"
echo "===================="
cd "$BASE_DIR/$repo"
git fe
git ba | grep $BRANCH_NAME
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment