Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete merged branches #331

Open
leque opened this issue Aug 3, 2022 · 2 comments
Open

Delete merged branches #331

leque opened this issue Aug 3, 2022 · 2 comments

Comments

@leque
Copy link
Contributor

leque commented Aug 3, 2022

There are 100+ branches in this repository.

How about deleting1 merged branches?

list of branches already merged to master:

$ git branch --remotes --merged origin/master | grep -v '/master$' | wc -l
115
$ git branch --remotes --merged origin/master | grep -v '/master$'
  origin/backend
  origin/backend-camlpdf
  origin/classandid
  origin/cross-ref
  origin/cross-ref2
  origin/dev-cff-otf
  origin/dev-chars-in-math
  origin/dev-code-in-text
  origin/dev-code-position
  origin/dev-diacritic
  origin/dev-footnote
  origin/dev-glue-graphics
  origin/dev-hyph
  origin/dev-import
  origin/dev-log-and-exp
  origin/dev-macro-on-multi-stage
  origin/dev-macro-with-interpreter-updated
  origin/dev-math-sub-sup
  origin/dev-md
  origin/dev-multicolumn
  origin/dev-page-break
  origin/dev-pkgs
  origin/dev-regexp
  origin/dev-text-backend
  origin/dev-two-column
  origin/dev-warning-for-overfull
  origin/develop
  origin/development
  origin/doc-primitive
  origin/east-asian-width
  origin/embed-block-breakable
  origin/external-repo
  origin/fix-about-types-in-modules
  origin/fix-as-to-fonts
  origin/fix-break-opportunity
  origin/fix-chunk
  origin/fix-ci-as-a-workaround-for-cinaps
  origin/fix-clear-page
  origin/fix-font-stretch-of-width-class
  origin/fix-frame
  origin/fix-graphics
  origin/fix-input-horz
  origin/fix-itemize
  origin/fix-math-chars
  origin/fix-math-lower
  origin/fix-math-sup
  origin/fix-module
  origin/fix-outmost-type-checking
  origin/fix-page-break
  origin/fix-polymorphism
  origin/fix-stage-1-binding
  origin/fix-stage-1-binding-sub
  origin/fix-type-check-only
  origin/fixtyenv
  origin/font-subset
  origin/frontend
  origin/images
  origin/inline-math-command
  origin/introduce-multi-stage
  origin/kindenv
  origin/level-based
  origin/load-font
  origin/lwitemize
  origin/manual-type
  origin/math
  origin/math-spacing
  origin/migrate-to-otfm-0-3-3-satysfi
  origin/min-first-line-ascender
  origin/modify-math-char
  origin/module
  origin/module-rebirth
  origin/mono-and-poly
  origin/move-non-primitive-op
  origin/omd
  origin/open-module
  origin/optional-arg
  origin/proc-chars
  origin/pullreq-elpinal-float-ceil-floor
  origin/pullreq-elpinal-sig
  origin/pullreq-konn-bits
  origin/pullreq-leque-2-remove-dep-on-ruby
  origin/pullreq-leque-3-libsatysfi
  origin/pullreq-leque-4-refactor-parser
  origin/pullreq-leque-rewrite-gencode
  origin/pullreq-matsud224-1
  origin/pullreq-matsud224-crlf
  origin/pullreq-matsud224-hyperlink2
  origin/pullreq-matsud224-module-name
  origin/pullreq-matsud224-outline
  origin/pullreq-matsud224-touccmap-ligature
  origin/pullreq-nekketsuuu-show-pages
  origin/pullreq-yasuo-ozu-2-add-clip
  origin/range
  origin/record
  origin/record-update
  origin/refactor-font-format
  origin/refactor-parser
  origin/refactor-typechecker
  origin/reform
  origin/reftyvar
  origin/release-0-0-7
  origin/script-guard
  origin/script-guard-both
  origin/separate-local-from-dist
  origin/separate-value4
  origin/set-every-word-break
  origin/syntext
  origin/tabular
  origin/text-backend
  origin/to-unicode-cmap
  origin/typechecker
  origin/typerange
  origin/tysyn
  origin/variant
  origin/xpltyvar

to delete them:

git branch --remotes --merged origin/master |
  grep -v '/master$' |
  sed -e 's;^ *origin/;;' |
  xargs -n 1 git push --delete origin

Footnotes

  1. Git - Remote Branches

@gfngfn
Copy link
Owner

gfngfn commented Aug 13, 2022

Thank you for suggestion! I will do that.

@gfngfn
Copy link
Owner

gfngfn commented Aug 13, 2022

It seems that the deletion has been successfully done (although some of the still remaining branches are no longer used):

$ curl 'https://api.github.com/repos/gfngfn/SATySFi/branches' | jq -r '.[] | .name'
dev-0-1-0-fix-type-env
dev-0-1-0-make-modules-and-staging-coexist
dev-0-1-0
dev-annot
dev-code-in-text
dev-code-position
dev-log-and-exp
dev-macro-on-multi-stage
dev-macro-with-interpreter-updated
dev-make-class-files-add-document-information
dev-migration-to-row-polymorphism
dev-multicolumn
dev-rendition
dev-two-column
dev-warning-for-overfull
fix-brace
fix-ci-as-a-workaround-for-cinaps
fix-font-stretch-of-width-class
fix-itemize
fix-outmost-type-checking
fix-page-break
fix-possible-error-in-tyenv
fix-stage-1-binding
fix-stage-1-binding-sub
fix-type-check-only
fix-value-restriction
introduce-multi-stage
master
migrate-to-otfm-0-3-3-satysfi
modify-cd
$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants