【发布时间】:2011-07-13 21:44:49
【问题描述】:
我在 Git 存储库中管理了一个简单的项目。到目前为止,我还没有故意创建任何分支,但是当我尝试使用今天创建我的第一个分支时
$ git branch mybranch
我看到了这个错误:
warning: refname 'master' is ambiguous.
fatal: Ambiguous object name: 'master'.
深入挖掘:
$ git branch -a
* master
remotes/master/HEAD -> master/master
remotes/master/master
这在 Git 中是否正常?我是否错误地克隆了我的存储库?解决此问题的最佳方法是什么?
【问题讨论】:
-
克隆时您确实做了一些奇怪的事情。要正确克隆,请使用
git clone [url] [destination path]。如需更多诊断帮助,请发布您在运行时获得的信息git config -l -
谢谢马克,我得到:core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true core.ignorecase=true remote.master.fetch=+refs/heads/ *:refs/remotes/master/* remote.master.url=git@github.com:###/###.git branch.master.remote=master branch.master.merge=refs/heads/master跨度>
标签: git git-branch