Usage
$ bash update-user-branches.sh 'Artyom Olshevskiy'
Script
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 | |
set -e | |
git pull origin master | |
BRANCHES="" | |
for branch in $(git branch -r); do | |
if git log ${branch}^..${branch} | grep "$1" > /dev/null ; then | |
branch=$(echo $branch | sed s/.*\\///) | |
BRANCHES="$BRANCHES $branch" | |
fi | |
done | |
for branch in $BRANCHES; do | |
git checkout $branch | |
git merge master | |
git push origin $branch | |
git checkout master | |
git branch -d $branch | |
done |
Комментариев нет:
Отправить комментарий