How can I archive git branches?

后端 未结 11 2240
無奈伤痛
無奈伤痛 2020-11-27 09:00

I have some old branches in my git repository that are no longer under active development. I would like to archive the branches so that they don\'t show up by default when r

11条回答
  •  猫巷女王i
    2020-11-27 09:33

    My approach is to rename all branches I don't care about with a "trash_" prefix, then use:

    git branch | grep -v trash
    

    (with a shell key binding)

    To retain the coloring of the active branch, one would need:

    git branch --color=always | grep --color=never --invert-match trash
    

提交回复
热议问题