How can I archive git branches?

后端 未结 11 2238
無奈伤痛
無奈伤痛 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条回答
  •  半阙折子戏
    2020-11-27 09:19

    You can use a script that will archive the branch for you

    archbranch

    It creates a tag for you with the prefix archive/ and then deletes the branch. But check the code before you use it.


    Usage - $/your/location/of/script/archbranch [branchname] [defaultbranch]

    If you want to run the script without writing the location to it add it to your path

    Then you can call it by

    $ archbranch [branchname] [defaultbranch]
    

    The [defaultbranch] is the branch that it will go to when the archiving is done. There are some issues with the color coding but other then that it should work. I've been using it in projects for a long time, but it is still under development.

提交回复
热议问题