请参阅git所有在两次提交之间进行的提交(跨分支机构) [英] See git a list of all commits that went between two commits (across branches)

查看:107
本文介绍了请参阅git所有在两次提交之间进行的提交(跨分支机构)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个分支,其中提交是独立完成的,我想运行一个Git命令,它将显示所有在特定时间范围内进行的提交(表示为提交哈希),无论分支如何。



这是我用于演示的测试回购: https://github.com / jsniecikowski / testApp



如果我们将Git的历史想象为一个列表(最新的列表):


  • 4332e0e发布分支

  • 18bc14a发布分支

  • 主分支上90f9149
  • $发行分支上的b $ b
  • 4f6e07f
  • $发行分支上的
  • ca404cf
  • $发布分支上的
  • 6cf47b3


      然后我想说:'给我所有发生在'90f9149'和'4332e0e'之间的变化。
      理想情况下,我会得到一个提交:18bc14a



      我的理解是此命令可以工作:

        git log --full-index --no-abbrev --format = raw -M -m --raw 90f9149d2f7367738e9d6f4a53c2c325f96a9b5f..4332e0eb24e18119b10835e361915f1f5eff16bc 

      然而,这个命令返回的结果比预期的要多。



      这是git的错误,或者我在命令中遗漏了什么?

      解决方案

      Gauthier的优秀答案非常接近,但没有说明如何使用散列用于指定我们想要检查的区域。



      建立在此基础上:

        git log Build-Release-Testing --since =$(git log -1 90f9149d2f7367738e9d6f4a53c2c325f96a9b5f --pretty =%ad)--until =$(git log -1 4332e0eb24e18119b10835e361915f1f5eff16bc --pretty =%广告)

      剩下的部分是消除返回。


      I have two branches where commits are made independently and I would like to run a Git command that will show me all commits that went in between a certain timeframe (expressed as commit hashes) regardless of branch.

      This is my test repo for the purpose of demonstration: https://github.com/jsniecikowski/testApp

      If we were to imagine Git's history as a list (latest on top):

      • 4332e0e on release branch
      • 18bc14a on release branch
      • 90f9149 on master branch
      • 4f6e07f on release branch
      • ca404cf on release branch
      • 6cf47b3 on release branch

      then I would like to say: 'give me all changes that happened between '90f9149' and '4332e0e'. Ideally I would get one commit: 18bc14a

      My understanding is that this command would work:

      git log --full-index --no-abbrev --format=raw -M -m --raw 90f9149d2f7367738e9d6f4a53c2c325f96a9b5f..4332e0eb24e18119b10835e361915f1f5eff16bc
      

      However, this command is returning more results than expected.

      Is this a bug with git, or am I missing something in my command?

      解决方案

      Gauthier's excellent answer was very close but it didn't say how to use hashes for specifying the region we want to check.

      Building on top of that I did:

      git log Build-Release-Testing --since="$(git log -1 90f9149d2f7367738e9d6f4a53c2c325f96a9b5f --pretty=%ad)" --until="$(git log -1 4332e0eb24e18119b10835e361915f1f5eff16bc --pretty=%ad)"
      

      The remaining part is to eliminate the specified hashes from the return.

      这篇关于请参阅git所有在两次提交之间进行的提交(跨分支机构)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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