Git:无法将jQuery子模块更新为1.11.3或1.12-stable

时间:2015-11-24 11:38:18

标签: jquery git

我的git子模块定义为

[submodule "protected/vendor/jquery-submodule"]
path = protected/vendor/jquery-submodule
url = git@github.com:jquery/jquery.git

实际上是在标签1.11.2处签出。

继续official jQuery repo on Github我看到一个分支1.12-stable和一个标记1.11.3

所以我已经从子模块文件夹

中执行了
git fetch
git checkout tags/1.11.3 

但它告诉我:

error: pathspec 'tags/1.11.3' did not match any file(s) known to git.

所以我试过

git tag -l

并且未列出我要查找的新标记和新分支。

我做错了什么?

1 个答案:

答案 0 :(得分:0)

我决定用

git checkout origin/1.12-stable

我认为这可行,因为当我做的时候

git branch -a

(不是-a)它列出了我

* master
  origin/1.11-stable
  origin/1.12-stable
  origin/1.9-stable
  origin/1.x-master
  origin/2.1-stable
  origin/2.2-stable
  origin/HEAD
  origin/compat
  origin/delegation
  origin/killphp
  origin/master
  origin/standard-then
  origin/standard-then-tests
  origin/standard-then-tests-fixed

所以我尝试过并且有效。

关于标记问题,我在this StackOverflow question

中找到了以下命令
git fetch git@github.com:jquery/jquery.git "refs/tags/*:refs/tags/*"

它告诉我

remote: Counting objects: 45, done.
remote: Total 45 (delta 23), reused 23 (delta 23), pack-reused 22
Unpacking objects: 100% (45/45), done.
From git@github.com:jquery/jquery
 * [new tag]         1.11.3     -> 1.11.3
 * [new tag]         2.1.4      -> 2.1.4
 * [new tag]         3.0.0-alpha1 -> 3.0.0-alpha1
 * [new tag]         3.0.0-alpha1+compat -> 3.0.0-alpha1+compat

最后

git checkout 1.11.3

它有效!!!!