“git ls-remote"的输出显示“git tag -l"中未找到的标签 [英] Output from 'git ls-remote' shows tags not found in 'git tag -l'

查看:63
本文介绍了“git ls-remote"的输出显示“git tag -l"中未找到的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照 Pro Git 的指导将 SVN 存储库转换为 Git 存储库(可在此处找到:http://progit.org/book/ch8-2.html).

I am converting a SVN repository to a Git repository following guidance from Pro Git (found here: http://progit.org/book/ch8-2.html ).

推送到我新创建的遥控器后,我从所述遥控器进行了克隆.新克隆没有关于我的标签的任何信息.然后我从原始文件中做了一个git push --tags".但是,在克隆中执行 'git pull' 时,只有少数标签会出现.

After pushing to my newly created remote, I did a clone from said remote. New clone did not have any information about my tags. I then did a 'git push --tags' from the original. However, when doing a 'git pull' in the clone, only a few of the tags come down.

从克隆内部,'git ls-remote' 显示了我的所有标签(和分支).为了清楚起见,我删除了哈希:

From inside the clone, 'git ls-remote' shows all of my tags (and branches). I removed the hashes for clarity:

HEAD
refs/heads/STABLE-1.0
refs/heads/UNSTABLE-1.0
refs/heads/master
refs/tags/RELEASE-0.4
refs/tags/RELEASE-0.9
refs/tags/RELEASE-1.0
refs/tags/STABLE-1.0
refs/tags/UNSTABLE-1.0

但是,执行 'git tag -l' 只会显示:

However, doing a 'git tag -l' only shows:

RELEASE-1.0
UNSTABLE-1.0

远程分支似乎跟踪良好.我注意到的唯一工件是原始 git-svn 存储库仍然具有本地和远程分支.这应该无关紧要,因为我将在克隆中工作,一旦我确认所有数据都已迁移,git-svn 存储库就可以退役了.

Remote branches seem to be tracking fine. Only artifact I noticed there is the orignal git-svn repo has the local and remote branches still. That should not matter since I will be working in a clone, and once I confirm all data is migrated, the git-svn repo can be decommissioned.

那么为什么远程和本地标签不匹配?

So why do the remote and local tags not match?

推荐答案

尝试 git fetch --tags - 来自 git-fetch 文档:

Try git fetch --tags - from git-fetch documentation:

在下载分支头时会自动获取大多数标签,但此机制不会获取不指向可从正在跟踪的分支头到达的对象的标签.此标志允许下载所有标签及其关联对象.

Most of the tags are fetched automatically as branch heads are downloaded, but tags that do not point at objects reachable from the branch heads that are being tracked will not be fetched by this mechanism. This flag lets all tags and their associated objects be downloaded.

这篇关于“git ls-remote"的输出显示“git tag -l"中未找到的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆