Created
January 9, 2013 06:54
-
-
Save walf443/4491189 to your computer and use it in GitHub Desktop.
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]origin/masterへmergeずみのリモートブランチをまとめてお掃除したい。 | |
** まとめ | |
>|| | |
$ git fetch --prune | |
$ git fetch | |
$ git branch -r --merged origin/master | grep -v origin/master | sed -e 's/origin\//:/' | xargs echo git push origin | |
||< | |
** ポイント | |
- git fetch --pruneしないと、git branch -rの結果がリモートブランチと一致しないことがある。 | |
- git branch -r --merged origin/masterで、origin/masterをベースに、mergeされたリモートブランチ一覧を得られるので、それを置換して、git pushでタグを消すコマンドをxargsで作る。 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment