Reputation: 12970
I had lots of changes in my local git fork, I do:
git add -A
git commit -m "commit message"
git push
to my originNow It happens that there are several other commits (from others) between my previous commit and my new commit.
I want to see all the changes done by me in my new commit and work on it. So, I do
git reset --soft <my previous commit>
It shows files modified by me and also by others.
Question:
git diff
.Upvotes: 2
Views: 2483
Reputation: 24204
You can filter only your commits then compare with HEAD.
$ git log --author=<user> # see your commits and copy commit-sha
$ git diff <commit-sha>..HEAD # shows what is in HEAD that is not in <commit>
Upvotes: 2
Reputation: 5719
You are making things so complex. Instead of soft reset, simply use git diff
and pass your commit and the one before to see what has been changed:
git diff xxxxxx yyyyyy
Where xxxxxx is the first and yyyyyy is the second commit hash values. To get the commit hash value use git reflog
.
More info here.
UPDATE:
As suggested in comments, you can also use git difftool xxxxxx yyyyyy
for a visual diff.
Upvotes: 5