Created
August 6, 2019 20:00
-
-
Save bmiselis/9cbc92679449efe91de1943f841b470f to your computer and use it in GitHub Desktop.
Clean repository after Pull Request has been successfully merged.
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 | |
# Go to user-specified branch. | |
git checkout $1 | |
# Get newest changes after PR merge. | |
git pull | |
# Update tracked remote branches. | |
git fetch --prune | |
# Delete all local branches that are already merged to master. | |
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment