Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Simple Git branch hash visualizer thing
# This is a quick & dirty way of comparing a bunch of various repositories
# visually to understand divergence. Made this very relaxed so anyone with
# shell experience can modify it to their whim.
# Suggestions include having comparitive operations between branch names,
# maybe giving an error if ANY divergence is encountered, or maybe trying
# to automatically merge branches if doing something silly like Git flow.
# Array of services to check
services=(service_one service_two service_three)
# Checkout services from Git, check branches
for service in ${services[@]}; do
cd ${service_dir}
if [[ ! -d ${service} ]]; then
git clone${service}.git
cd ${service}
git checkout feature_branch
git checkout release
cd ${service}
feature_branch=$(git rev-parse origin/feature_branch)
master=$(git rev-parse origin/master)
echo "${service}: ${feature_branch} & ${master}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment