Created
February 27, 2019 04:17
-
-
Save techlunacy/ccd163d2d8f8f72b25848565074dfea1 to your computer and use it in GitHub Desktop.
repository maintinence tasks
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
| git fetch | |
| git remote prune origin | |
| git branch --no-color -r --merged | grep -v master | sed 's/origin\// /' | xargs -n 1 git push --delete origin |
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
| git checkout master | |
| git pull | |
| for BRANCH in $(git --no-pager branch --no-color -r --no-merged | sed -e 's/origin\///'); | |
| do git checkout $BRANCH ; | |
| git pull | |
| GIT_EDITOR=true git merge --strategy-option theirs origin/master | |
| git reset --hard HEAD | |
| git push origin $BRANCH | |
| done | |
| git checkout master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment