home/bin/removeMerged.sh

22 lines
342 B
Bash
Raw Normal View History

2020-04-25 21:01:04 +02:00
#! /bin/bash
# Checkout develop
git develop
if [ $? = 1 ] ; then
git checkout dev
fi
2021-05-25 08:13:41 +02:00
if [ $? = 1 ] ; then
git checkout master
fi
2020-04-25 21:01:04 +02:00
# Get last changes
git pull
# Get list of available remote's branch
git fetch --prune origin
# List merged branch and remove it
git branch --merged | egrep -v "(^\*|master|dev)" |xargs git branch -d