是“大师”吗? git 中的标准分支名称,或者只是标准做法?
我注意到 git 中经常使用“master”和“origin”这两个名字。它们之间有什么区别,是 git 中的标准,还是只是常见的做法?哪个是存储库的根文件夹?
I noticed the names "master" and "origin" being used a lot in git. What's the difference between these, and are either standard in git, or are they just common practice? Which would be the root folder of the repository?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
master
是创建存储库时在 Git 中创建的默认分支。这是非常标准的,但你可能有一个没有主分支的存储库。您可以删除或重命名它,但通常不建议这样做。origin
是您克隆的远程位置,由 git 设置。它也是非常标准的,但您可以删除它或重命名它或添加远程源而不进行克隆。请注意,在 git 中创建的所有存储库都带有 master。但只有克隆人才有起源。
master
is the default branch that is created in Git when you create a repo. It is pretty standard, but you may have a repo without master branch. You can delete or rename it, but it is generally not advised.origin
is the remote from which you clone from and is set up by git. It is also pretty standard, but you may delete it or rename it or add a remote origin without cloning.Note that all repos created in git come with master. But only cloned ones come with origin.