【问题标题】:Git: unable to update jQuery submodule to 1.11.3 or 1.12-stableGit:无法将 jQuery 子模块更新为 1.11.3 或 1.12-stable
【发布时间】:2015-11-25 00:25:42
【问题描述】:

我的 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

而且我要找的新标签和新分支都没有列出来。

我做错了什么?

【问题讨论】:

  • 当您 cd 进入子模块并输入 git reset --hard 1472290917f17af05e98007136096784f9051fab 时会发生什么? (这是 1.11.3 的 SHA)。另外,我猜git fetch实际上带来了变化?
  • git reset --hard 1472290917f17af05e98007136096784f9051fab 给我错误fatal: Could not parse object '1472290917f17af05e98007136096784f9051fab'.
  • 当您在子模块中输入git fetch 时,它是否带来了任何变化?
  • @HBHB:是的,它获取了“某些东西”。我不记得是什么了,但有些东西被取出了。现在我检查了master,然后是git pull,但在列出标签时再次没有找到新标签...阿门

标签: jquery git


【解决方案1】:

我解决了

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

成功了!!!!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-20
    • 1970-01-01
    • 1970-01-01
    • 2011-08-15
    • 2012-04-27
    • 2012-09-14
    • 1970-01-01
    • 2012-07-09
    相关资源
    最近更新 更多