【问题标题】:Missing git tags when push to remote repository (e.g. Google Source Repositories)推送到远程存储库时缺少 git 标签(例如 Google 源存储库)
【发布时间】:2019-09-27 16:24:05
【问题描述】:

我刚刚建立了一个本地 git 存储库并将其复制到远程存储库,基于 Google“云源存储库”。这大部分工作正常,除了标签没有被复制。我有一些旧的谷歌存储库,以相同的方式构建(据我所知),它们确实有标签。所以我不确定发生了什么。

这个过程是:

  • 创建本地 git 存储库(ubuntu 18.04 机器上的 git 2.17.1),
  • 添加一些文件并提交,
  • 沿git tag -a V1.0.0 -m "The initial working version"的行添加一些标签,
  • 更新并添加更多文件(这是我为我的团队编写的培训指南)并添加更多标签,并且
  • 然后设置一个 google repo,通过 Google SDK 连接到它 机制,以及git push --all google

所有这些似乎都运行良好,除了远程仓库中没有标签。 git tags 命令的输出如下所示,我可以在 gitk GUI 中看到这些标签。所以问题不在于本地回购。这些标签还没有进入 Google 的存储库。

以前有没有人见过这个问题,或者可以建议我接下来看什么?

$ git tag
V1.0.0
V1.0.1
V1.1.0
V2.0.0

推送输出如下:没有错误。

git push --all google
Counting objects: 25, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (20/20), done.
Writing objects: 100% (25/25), 5.03 KiB | 2.51 MiB/s, done.
Total 25 (delta 7), reused 0 (delta 0)
remote: Resolving deltas: 100% (7/7)
To https://source.developers.google.com/p/<REDACTED>/r/git_test
 * [new branch]      master -> master

【问题讨论】:

  • 你试过git push --tags吗?
  • 刚刚试了一下:效果很好! --all 实际上并不意味着 all 有点惊讶,而且我很确定我之前不必显式推送标签,但我想情况会发生变化。

标签: git tags google-source-repositories


【解决方案1】:

感谢 John 指出预期的行为!来自git-scm.com/book "默认情况下,git push 命令不会将标签传输到远程服务器。"

所以你需要一个明确的:git push --tags google 在我的情况下,或git push --tags origin 在典型情况下。

【讨论】:

    猜你喜欢
    • 2011-07-08
    • 2018-06-24
    • 2010-10-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-05
    • 2014-01-25
    相关资源
    最近更新 更多