Set of scripts to help keep git repositories in good order.
no longer needed = already merged to main or last commit older than specified time reference (1 month ago by default)
cd your-git-repository
$SCRIPTS_DIR/remove_branches.sh --remove-local --remove-remote
specify explicitly how old branches can be
cd your-git-repository
$SCRIPTS_DIR/remove_branches.sh --remove-local --remove-remote --older-than '3 months ago'
dry run (prints what would be deleted)
cd your-git-repository
$SCRIPTS_DIR/remove_branches.sh --dry-run --remove-local --remove-remote
cd your-git-repository
grep -F -v -f <($SCRIPTS_DIR/all_unnecessary_branches.sh) <(git branch -r)
cd your-git-repository
$SCRIPTS_DIR/find_merged_branches.sh
cd your-git-repository
$SCRIPTS_DIR/find_old_branches.sh --older-than '1 year ago'
This code is open source software licensed under the Apache 2.0 License.