来自“git ls-remote”的输出显示在“git tag -l”中找不到的标签

发布于 2024-12-09 11:11:24 字数 745 浏览 0 评论 0原文

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

推送到我新创建的遥控器后,我从所述遥控器进行了克隆。新克隆没有任何关于我的标签的信息。然后我从原来的版本中做了一个“git push --tags”。然而,当在克隆中执行“git pull”时,只有少数标签会下来。

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

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”仅显示:

RELEASE-1.0
UNSTABLE-1.0

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

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

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

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.

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

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

RELEASE-1.0
UNSTABLE-1.0

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

⒈起吃苦の倖褔 2024-12-16 11:11:24

尝试 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文