Created
December 12, 2018 01:06
-
-
Save alloydwhitlock/0db379a6e0ad6581711161e0bce9322e to your computer and use it in GitHub Desktop.
Simple Git branch hash visualizer thing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 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) | |
service_dir=$(pwd) | |
# Checkout services from Git, check branches | |
for service in ${services[@]}; do | |
cd ${service_dir} | |
if [[ ! -d ${service} ]]; then | |
git clone [email protected]:alloydwhitlock/${service}.git | |
cd ${service} | |
git checkout feature_branch | |
git checkout release | |
else | |
cd ${service} | |
fi | |
feature_branch=$(git rev-parse origin/feature_branch) | |
master=$(git rev-parse origin/master) | |
echo "${service}: ${feature_branch} & ${master}" | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment