分支创建时出错:“warning:refname'master'不明确。” [英] Error on branch creation: "warning: refname 'master' is ambiguous."

查看:1636
本文介绍了分支创建时出错:“warning:refname'master'不明确。”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的项目在Git仓库中进行管理。到目前为止,我还没有故意创建任何分支,但是当我尝试使用

I've had simple project being managed in a Git repository. To date I haven't intentionally created any branches, but when I tried to create my first today using

$ git branch mybranch

我看到这个错误:

I see this error:

warning: refname 'master' is ambiguous.
fatal: Ambiguous object name: 'master'.

深挖:

Digging deeper:

$ git branch -a          
* master
remotes/master/HEAD -> master/master
remotes/master/master

这在Git中是否正常?我是否错误地克隆了我的存储库?解决这个问题的最好方法是什么?

Is this normal to see in Git? Have I cloned my repository incorrectly? What is the best way to resolve this problem?

推荐答案

它似乎是不明确的,因为您的远程名称和分支名称都是。您可以尝试通过运行

It seems it's ambiguous because your remote name and branch name are both master. You can try renaming the remote to the more conventional origin by running

git remote rename master origin

这篇关于分支创建时出错:“warning:refname'master'不明确。”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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