git 标签还没有推送到远程

标签 git

在 Git 中,我创建了一些本地标签,并且只有其中一些我想推送到源。

一段时间后,我想检查一下推送到远程时遗漏了哪些标签。

我们是否有命令显示所有在本地仓库中但尚未推送到远程仓库的标签?

谢谢。

最佳答案

考虑一个 git push can also push tags ,您可以使用 git push --dry-run 来预览推送并查看标签是否被推送。

git push --tags --dry-run

这将列出远程不存在的本地标签。
如果输出为空,则所有标签都已推送。

请注意,如“How can I see what I am about to push with git?”中所述:

The problem with git push --dry-run is that it still requires write permission at the remote.
So if you have a clone without permission to push upstream, but you'd like to see what your local unpushed changes are, --dry-run won't do it.

在那种情况下,knittl提到的脚本解决方案在 the comments (git ls-remote --tags origin vs. git tag)是另一种选择。

关于git 标签还没有推送到远程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30611831/

相关文章:

Git merge 错误

xcode 无法识别 Git 项目

Git 推送 - 致命 : write error: Bad file descriptor

git - 覆盖 merge 中的本地更改

git - 如何重命名 Git 标签?

git - 如何找到以前的 merge 提交

如果远程文件夹包含空格,则 Git pull

git - 在 Windows 上的 Git Bash 中设置提示颜色

git - CtrlP:忽略 git repo 子目录中的文件

Git如何检测整个文件夹已删除/移动