推送到远程存储库时缺少 git 标签(例如 Google 源存储库)
Missing git tags when push to remote repository (e.g. Google Source Repositories)
我刚刚建立了一个本地 git 存储库并将其复制到远程存储库,基于 Google "Cloud Source Repository"。这大部分工作正常,除了标签没有被复制。我有一些旧的 google 存储库,以相同的方式构建(据我所知),它们确实有标签。所以我不确定发生了什么。
过程是:
- 创建本地 git 存储库(git 2.17.1 在 ubuntu 18.04 机器上),
- 添加一些文件并提交它们,
- 按照
git tag -a V1.0.0 -m "The initial working version"
、 添加一些标签
- 更新并添加更多文件(这是我为我的团队编写的培训指南)并添加更多标签,并且
- 然后设置一个 google 存储库,通过 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
感谢 John 指出预期的行为!来自 git-scm.com/book "By default, the git push command doesn’t transfer tags to remote servers."
所以你需要一个明确的:在我的例子中是 git push --tags google
,或者在典型的例子中是 git push --tags origin
。
我刚刚建立了一个本地 git 存储库并将其复制到远程存储库,基于 Google "Cloud Source Repository"。这大部分工作正常,除了标签没有被复制。我有一些旧的 google 存储库,以相同的方式构建(据我所知),它们确实有标签。所以我不确定发生了什么。
过程是:
- 创建本地 git 存储库(git 2.17.1 在 ubuntu 18.04 机器上),
- 添加一些文件并提交它们,
- 按照
git tag -a V1.0.0 -m "The initial working version"
、 添加一些标签
- 更新并添加更多文件(这是我为我的团队编写的培训指南)并添加更多标签,并且
- 然后设置一个 google 存储库,通过 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
感谢 John 指出预期的行为!来自 git-scm.com/book "By default, the git push command doesn’t transfer tags to remote servers."
所以你需要一个明确的:在我的例子中是 git push --tags google
,或者在典型的例子中是 git push --tags origin
。