Created
February 16, 2012 21:02
-
-
Save localshred/1847820 to your computer and use it in GitHub Desktop.
git helpers for mainline branch synchronization and checking
This file contains hidden or 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
# Synchronize all mainline branches (master, qa, stage, stable) | |
function reposync() { | |
git fetch | |
git checkout master | |
git rebase origin/master | |
git checkout qa | |
git rebase origin/qa | |
git checkout stage | |
git rebase origin/stage | |
git checkout stable | |
git rebase origin/stable | |
git checkout master | |
} | |
# Upstream out-of-date branch check (e.g. what does master have that qa doesn't) | |
function upcherry() { | |
echo 'Upstream out-of-date branch check' | |
echo '[master > qa]' | |
git ch qa master | |
echo '[qa > stage]' | |
git ch stage qa | |
echo '[stage > stable]' | |
git ch stable stage | |
} | |
# Downstream out-of-date branch check (e.g. what does stable have that master doesn't) | |
function dncherry() { | |
echo 'Downstream out-of-date branch check' | |
echo '[qa > master]' | |
git ch master qa | |
echo '[stage > qa]' | |
git ch qa stage | |
echo '[stable > stage]' | |
git ch stage stable | |
echo '[stable > master]' | |
git ch master stable | |
} | |
# Run the upcherry command against all repos (does not assume up-to-date) | |
function srvupcherry() { | |
for repo in repo1 repo2 ... repoN; | |
do | |
echo $repo | |
cd /code/src/$repo | |
upcherry | |
echo '----' | |
done | |
} | |
# Run the dncherry command against all repos (does not assume up-to-date) | |
function srvdncherry() { | |
for repo in repo1 repo2 ... repoN; | |
do | |
echo $repo | |
cd /code/src/$repo | |
dncherry | |
echo '----' | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment