git显示由我或文件夹中的任何人提交的最近10次提交所做的更改作为整合更改 [英] git show changes done by last 10 commits by me or anyone in a folder as a consolidated change
问题描述
引用我的 这是该问题的延续 在一次提交中,我添加了几行代码,在接下来的提交中,我删除了这些行。 我想: 查看我在该目录的最近10次提交中完成的所有更改(即,仅由我完成的更改)作为统一更改,并将文件中的所有更改视为单个空间。 查看在最近10次提交中任何人在该目录中所做的所有更改,作为统一更改,我将文件中的所有更改视为单个空间。
我有一个git仓库,其中有一个文件夹。在此文件夹中,多人进行更改。
让我们把这些行称为X.
更适合于先前建议的
Ie for me我不应该看到这些行 X
,并且应该看到每个文件只有一次 - b $ b和
对于我,我不应该看到那些第X行,并应该看到每个文件只有一次 git diff
git log
然后:
git diff @〜10 @ - 路径/到/文件夹
或
git diff HEAD〜10 HEAD - 路径/ to / folder
(带 @
是 HEAD
的快捷键,git 1.8.4 + p>
注意:正确地 try-catch-finally 指出,这对于作者无效:作者可以在提交级别过滤,而不是在补丁级别过滤。
这就是为什么我对前一个问题的回答使用了 git log --author = xxx -p
。
但要获得修补程序尽管如此,git diff仍然是正确的工具。
Reference to my original question
This is in continuation of that question I have a git repository in which I have a folder. In this folder multiple people makes changes. I have recently made few commits in that directory .
In one commit I added few lines of code and in next commit I removed those lines.
Lets call these lines as X.
I want to:
view all changes that I have done in last 10 commits in that directory (ie changes done by me only) as a consolidated change where I see all changes in a file as a single space.
Ie for me I should not see those linesX
and should see each file single time only
andview all changes that anyone has done in that directory in last 10 commits as a consolidated change where i see all changes in a file as a single space.
Ie for me I should not see those lines X and should see each file single time only
A git diff
is more suited than the previously suggested git log
then:
git diff @~10 @ -- path/to/folder
or
git diff HEAD~10 HEAD -- path/to/folder
(with @
being a shortcut for HEAD
, git 1.8.4+)
Note: as try-catch-finally rightly points out, this won't work regarding author: authorship can be filtered at the commit level, not so much at the patch level.
That is why my answer to the previous question used git log --author=xxx -p
.
But to get the patches in one consolidated result though, git diff remains the right tool.
这篇关于git显示由我或文件夹中的任何人提交的最近10次提交所做的更改作为整合更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!