Sha*_*neC 0 svn git version-control branch
我们正在玩Git,我们的一个开发人员希望从我们的存储库中删除旧的分支.这个要求的原因是"守管".
我来自SVN背景,并没有精通Git,但根据我对SVN的经验,你永远不会删除分支; 从第一天开始就是经验法则.
删除SVN中的分支没有任何好处,因为它的大小相对较小,并且可能包含重要的提交/合并信息,如果删除它们将完全丢失.而且,从保持住宅的角度来看,如果这个分支过于丑陋而无法看到,它总是可以移动到另一个完全不受常规工作流程影响的位置.
有没有人有任何具体的理由从现代版本控制系统中删除分支?
根据SO问题上接受的答案,"Git - 何时删除分支 ":
You can safely remove a branch with git branch -d yourbranch.
If it contains unmerged changes (ie, you would lose commits by deleting the branch),
git will tell you and won't delete it.
Run Code Online (Sandbox Code Playgroud)
但是,另一位作者确实声明:
the disadvantage of deleting branches is that you will break any hyperlinks
to those branches on GitHub.
Run Code Online (Sandbox Code Playgroud)
我发现的关于删除分支的缺点的最大论点之一在标题为" 为什么我不喜欢功能分支 " 的文章中讨论:
If feature branches are deleted once they are merged into master, where do bug
fixes go? On a new feature branch or on master? There will no longer be an easy way
to find a list of the commits that went into a feature.
Run Code Online (Sandbox Code Playgroud)
文章Git Basics:清理多余的分支,展示了如何选择这样做,如何自动删除分支并使其更快捷.
请让我知道,如果你有任何问题!