LoginSignup
3
1

More than 5 years have passed since last update.

gitのリモート、ローカルのマスター、デベロップ以外のマージ済みブランチを削除

Posted at

gitのリモート、ローカルのマスター、デベロップ以外のマージ済みブランチを削除
利用例:$ git sync
編集ファイル:~/.gitconfig

[alias]
        delete-merged-remote-branches = !git branch -a --merged | grep -vE '^\\*|master$|develop$' | grep remotes/origin | sed -e 's% *remotes/origin/%%' | xargs -I% git push --delete origin %
        delete-merged-local-branches = !git branch --merged | grep -vE '^\\*|master$|develop$' | xargs -I % git branch -d %
        sync = !git pull --all && git delete-merged-remote-branches && git delete-merged-local-branches
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1