问题描述
我正在使用git-flow和许多主题分支,又称为功能分支.当我决定采用完全不同的路线时,我正在开发功能分支.
I am using git-flow and many topic-branches, AKA feature branches. I was working on a feature branch, when it was decided to take an entirely different route.
我现在想删除该分支,因为其中的工作将不会合并到开发或主数据库中,而只会弄乱"分支列表.
I now want to remove that branch, as the work in there will not be merged into development or master and it only "clutters" the list of branches.
但我想将历史保留在该分支中,以用于历史和行政管理目的(以及我们所有人再次改变主意,必须挖出存档作品的可能性很小).
But I'd like to keep the history in that branch for historical and administrative purposes (and the odd chance that we all change our mind again and the archived work has to be dug out).
最佳路线是什么?我可以简单地git branch -D
使其在以后死亡吗?如果是这样,那么命令将是什么?
What would be the best route? Can I simply git branch -D
it and rise its death at a later moment? If so, what would be the command to do so?
推荐答案
您可能有一个墓地"仓库,与您的工作仓库分开,那里只有存档的分支吗?然后,您可以简单地将其连接为远程存储库,将已归档的分支推送到该存储库,然后从本地删除它.它仍然会以remotes/graveyard/feature
You could have a "graveyard" respoitory, separate from your working one, that just has archived branches in it? Then you can simply have it connected as a remote repository, push the archived branch to it and delete it from your local. It will still be there as remotes/graveyard/feature
这篇关于删除主题分支,出于管理目的存档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!