我应该在合并后删除分支吗? [英] Should I delete a branch after merging it?

查看:995
本文介绍了我应该在合并后删除分支吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

合并分支之后,是否将其从存储库中删除?

但是,这是一种好的做法吗?

我通常会创建很多分支,因为我不想破坏当前的版本,我希望删除它们以保持顺序。
但是,如果您使用Assembla或GitHub,旧分支的合并请求将保存在网站上,因此,如果删除它们,您将收到错误,因为它无法获取它们...



通常情况下如何管理? 在删除已合并的分支时没有问题。所有提交在历史记录中仍然可用,甚至在GitHub界面中,它们仍会显示出来(请参阅这个PR 指的是我在PR被接受后删除的一个分支)。


After merging a branch, do you delete it from the repository?
However, it's a good practice or not?

I usually create a lot of branches, since I don't want to break my current release, and I'd wish to delete them to keep things in order.
However, if you work with Assembla or GitHub, your merge requests from old branches will be saved on the site, so if you delete them you'll get an error since it won't be able to fetch them...

Usually how do manage that?

解决方案

There's no problem in deleting branches that have been merged in. All the commits are still available in the history, and even in the GitHub interface, they will still show up (see, e.g., this PR which refers to a fork that I've deleted after the PR got accepted).

这篇关于我应该在合并后删除分支吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆