Git子树标签 [英] Git subtree tags

查看:109
本文介绍了Git子树标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用子树合并将远程项目拖入我自己的git树中的目录。我遵循这里的指示:
使用子树合并



但我不确定如何签出标签。我想这是一个常见的请求 - 你想拉入一个外部项目,但得到一个安全标签的源代码版本。
子树合并解决方案效果很好,但我不确定如何获取我想要的标签?喜欢混帐,但有时它会伤害我的头......

/ code>您将获得存储库中所有标记的列表。远程标签也显示在这里,我不知道它们是否可能发生冲突(没有检查),以及如何检查哪些标签已导入到您的存储库。



但我所检查的是,当您添加远程并从其他项目获取时,您会看到导入了哪些标签。然后你可以合并该标签,例如:

  git merge -s我们的--no-commit v0.1.2#改为:bproject / master(2)
git read-tree --prefix = dir-B / -u v0.1.2#而不是:Bproject / master(3)



并且它应该有效。



希望它有一点帮助,但我不是按照我的意愿先进的git: - )


I want to use subtree merges to pull a remote project into a directory in my own git tree. I followed the instructions here: using subtree merge

But I'm not sure how to checkout a tag. I imagine this is a common request - you want to pull in an external project but get a safe tagged version of the source. The subtree merge solution works great, but I'm not sure how to get the tag I want? Love git, but sometimes it hurts my head....

解决方案

When you type git tag you'll get list of all tags in your repository. Remote tags also show here, and I don't know if they may conflict (didn't check that), and how to check what tags were imported to your repository.

But what I checked is that when you add remote and it fetches from other project, you see what tags are imported. Then you can merge with that tag, for example:

git merge -s ours --no-commit v0.1.2 # instead of: Bproject/master (2)
git read-tree --prefix=dir-B/ -u v0.1.2 # instead of: Bproject/master (3)

and it should work.

Hope it helps a little, but I'm not as advanced with git as I would like :-)

这篇关于Git子树标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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