Composer克隆GIT Commit而不是标记

Composer克隆GIT Commit而不是标记,git,github,composer-php,Git,Github,Composer Php,我已经完成了一个github项目,希望切换到我的分支机构。 我已经将repositories条目添加到我的分叉github项目中,composer启动了 克隆包 Installing antibodies-online/omnipay-vr-payment (1.1.0): Cloning 7df29fad5d 接下来,我检查原点是否是我的新叉子: git remote -v Output: composer https://github.com/DemigodCode/omn

我已经完成了一个github项目,希望切换到我的分支机构。 我已经将repositories条目添加到我的分叉github项目中,composer启动了 克隆包

Installing antibodies-online/omnipay-vr-payment (1.1.0): Cloning 7df29fad5d
接下来,我检查原点是否是我的新叉子:

git remote -v

Output:
composer        https://github.com/DemigodCode/omnipay-vr-payment (fetch)
composer        https://github.com/DemigodCode/omnipay-vr-payment (push)
origin  https://github.com/DemigodCode/omnipay-vr-payment (fetch)
origin  https://github.com/DemigodCode/omnipay-vr-payment (push)
没关系,还有我的叉子。现在我想列出所有可用的分支:

git branch -a

Output:
* (no branch)
  master
  remotes/composer/2DS20
  remotes/composer/master
  remotes/origin/2DS20
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
我缺少没有遥控器/原点的2DS20分支

如果我现在想切换到2DS20:

git checkout 2DS20
error: pathspec '2DS20' did not match any file(s) known to git.
我不知道这里发生了什么?在另一台服务器上,它工作完全正常。有什么想法吗

在另一台服务器上运行git status时,将打印以下内容:

# On Tag v1.1.0.
nothing to commit (working directory clean)
在我的机器上:

# Not currently on any branch.
nothing to commit (working directory clean)

对于所有面临该问题的其他人:

我们的机器上安装了Git 1.7.1。另一个运行2.11.x。更新到2.22.0,所有工作正常! 我们现在可以打字了

git checkout my-branch

它的工作原理与我期望的一样。

对于较旧版本的git,您必须更明确地说明起点

git checkout -b 2DS20 origin/2DS20
解释了更新、更方便的行为

git签出[]
…如果未找到
,但恰好在一个远程设备(称之为
)中存在具有匹配名称的跟踪分支,并且未指定
--无猜测
,则视为等同于

$ git checkout -b <branch> --track <remote>/<branch>
$git checkout-b--跟踪/