简体   繁体   English

Tortoise GIT - 显示合并后在分支中创建的更改

[英]Tortoise GIT - show changes created in branch after merge

Is it possible to show only commits and changes created in a specific branch? 是否可以仅显示在特定分支中创建的提交和更改? If I do this before merge it works. 如果我在合并之前这样做,它就有效。 If I merge master branch to this branch (to make it actual) then I see commits and merges made in master branch. 如果我将master分支合并到这个分支(使其成为实际),那么我会看到在master分支中进行的提交和合并。 Is there some way how to filter it? 有什么方法可以过滤它吗?

You can do this using git bash (packaged tool with git), it's an alternative. 你可以使用git bash(带git的打包工具)来做到这一点,它是另一种选择。 This is a more effective solution for this question: 对于这个问题,这是一个更有效的解决方案:

  • type the command: 输入命令:
git log --graph [branch] 
  • type this too: 输入这个:
git diff ..master path/to/file

Credits to the author @lukman of this answer to a similar question here on SO. 致于作者@lukman 在这里回答了类似的问题。

To see the branch before the merge, you can right-click on the commit before the merge on the branch you want to see, and click "Create branch at this revision". 要在合并之前查看分支,可以在要查看的分支上合并之前右键单击提交,然后单击“在此版本中创建分支”。

Then browse references, and right-click on your new branch and click "Show log". 然后浏览引用,右键单击新分支并单击“显示日志”。

The merge is not shown because it's not on this branch. 合并未显示,因为它不在此分支上。 This works if your merge is the last commit, but if it isn't you won't see anything after it. 如果您的合并是最后一次提交,则此方法有效,但如果不是,则不会在其后看到任何内容。

You can also branch off of your current branch, on rebase that branch to remove the merge completely. 您还可以分支当前分支,在rebase分支上完全删除合并。 This would also hide it on log view (again, only because it's not there). 这也会将其隐藏在日志视图中(同样,仅因为它不存在)。

In both cases, the original branch is still the same. 在这两种情况下,原始分支仍然是相同的。

In any case, there doesn't seem to be an easy way of doing this. 无论如何,似乎没有一种简单的方法可以做到这一点。 A "hide other branches" option would be nice. “隐藏其他分支”选项会很好。

  • Go to github.com/"your repository" 转到github.com/"your repository“
  • Select your branch from drop down. 从下拉列表中选择您的分支。
  • Click on 'compare' link on right side. 点击右侧的“比较”链接。
  • Here you can see commits which are present in your branch and not yet merged in master. 在这里,您可以看到分支中存在但尚未在master中合并的提交。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM