如何用git比较两个标签? [英] How to compare two tags with git?

查看:191
本文介绍了如何用git比较两个标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在两个标签之间进行区分,并在这两个标签之间提交更改.你能告诉我命令吗?

I would like to do a diff between two tags and committed changes between those two tags. Could you please tell me the command?

推荐答案

$ git diff tag1 tag2

或显示它们之间的日志:

or show log between them:

$ git log tag1..tag2

有时仅查看已更改的文件列表可能会很方便:

sometimes it may be convenient to see only the list of files that were changed:

$ git diff tag1 tag2 --stat

,然后查看某些特定文件的区别:

and then look at the differences for some particular file:

$ git diff tag1 tag2 -- some/file/name

标签仅是对该标签上"最新提交的引用,因此您可以对它们之间的提交进行比较.

A tag is only a reference to the latest commit 'on that tag', so that you are doing a diff on the commits between them.

另外,一个很好的参考: http://learn.github.com/p/diff. html

Also, a good reference: http://learn.github.com/p/diff.html

这篇关于如何用git比较两个标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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