显示哪些文件在两个修订之间发生了变化 [英] Showing which files have changed between two revisions

查看:99
本文介绍了显示哪些文件在两个修订之间发生了变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



来到这个链接: http://linux.yyz.us/git-howto.html 非常有用。



比较我遇到的分支的工具有:


  • git diff master..branch

  • git log master..branch

  • git shortlog master..branch



如果有git status master..branch之类的东西只能看到这两个分支之间不同的文件。



没有创建新工具,我认为这是您可以最近做到这一点(当然,如果一个文件被修改了多次,它会显示重复): c $ c> git diff master..branch | grep^ diff


想知道我是否错过了...

解决方案

比较当前分支与 master

  $ git diff --name-status master 



<比较任何一对分支

  $ git diff --name-status firstbranch..yourBranchName 

如果我正确理解你的话,那就应该做你所需要的。


I want to merge two branches that have been separated for a while and wanted to know which files have been modified.

Came across this link: http://linux.yyz.us/git-howto.html which was quite useful.

The tools to compare branches I've come across are:

  • git diff master..branch
  • git log master..branch
  • git shortlog master..branch

Was wondering if there's something like "git status master..branch" to only see those files that are different between the two branches.

Without creating a new tool, I think this is the closest you can get to do that now (which of course will show repeats if a file was modified more than once):

  • git diff master..branch | grep "^diff"

Was wondering if there's something I missed...

解决方案

To compare the current branch against master

$ git diff --name-status master

To compare any pair of branches

$ git diff --name-status firstbranch..yourBranchName

That should do what you need, if I understand you correctly.

这篇关于显示哪些文件在两个修订之间发生了变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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