如果我没有git master分支,将会怎样? [英] What will break if I don't have a git master branch?

查看:126
本文介绍了如果我没有git master分支,将会怎样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大多数git仓库都有一个master分支,但是这个名字确实没有什么特别的.您可以删除master分支,将另一个分支重命名为master,然后完全跳过master分支.

Most git repositories have a master branch, but there's really nothing special about this name. You can delete the master branch, rename another branch to master, skip having the master branch altogether.

git中是否有任何硬编码期望主分支?如果我的存储库中没有使用该名称的分支,那么有什么我可以期望的工作不正常吗?

Is anything in git hardcoded to expect a master branch? If I have a repository that doesn't have a branch with this name, is there anything I can expect to work improperly?

推荐答案

D VCS(如分散式")中的问题是"惯例"的概念这比传统的VCS更为重要.

The problem in a DVCS (as in "Decentralized") is the notion of "convention" which can be more important than for a classical VCS.

由于每个用户都将克隆存储库,因此他们可能已经有一些脚本可以解析"master"分支(例如

Since every user will clone the repository, they might have some script already in place which will parse for a "master" branch (like this build.pl perl script)

即使您可以在Subversion中使用任意名称命名或组织分支机构(),如果您发布存储库,则至少应遵守此约定,这可能是明智的选择.

Even though you can name or organize your branches with whatever name you want in Subversion (you are not required to have a "trunk" for instance), it might be wise, if you publish your repository, to respect at least this convention.

如果这纯粹是内部开发(例如出于备份目的而进行内部复制),则可以随意命名.

If this is purely internal development (with internal replication for backup purposes for instance), you can name it whatever you want.

这篇关于如果我没有git master分支,将会怎样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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