Git diff only my changes

git diff commit_A commit_Bshows me all the differences between AandB

Within the commits range A..B, commits --author=meand--author=someone else

Is there a way to get git difffor my cumulative changes between Aand B, excluding changes by others?

I suggest that one possible solution would be to analyze git log --author=meand “summarize” the differences for each commit together. Another potential idea would be to take git blameat a point Band filter by lines that were changed between Aand B.

Context:

Suppose I have been working on a large function for some extended period of time. During this work, I make many subfunction fixes. To update with the latest code base, git pullcreates a merger with the contributions of other contributors. I want to see what cumulative changes I have made so far without seeing changes in others. Suppose there are no merge conflicts (we are dealing with different areas of the code, but potentially in a single file.

+4
source share
1 answer

Is there a way to get diff git for my cumulative changes between A and B, excluding changes by others?

Not directly, no.

, git log --author = me "sum" .

, , ( , ): , commit A, , ( ), , , . diff . :

git checkout -b temp A
for commit in $(git rev-list A..B); do
    if want_commit $commit; then git cherry-pick $commit; fi
done
git diff A
git checkout realbranch; git branch -D temp

( : HEAD. .)

0

Source: https://habr.com/ru/post/1608840/


All Articles