I am curious to know about Git diff in this situation, i could not find in Git docs
Assume on branch A , i have three commits as
Branch A: Commit 3 <-- Commit 2 <-- Commit 1
Commit 3
is latest on branch.
- Now if we re-write the commit history i.e. rebase the recent
Head~2
commits and and squash them into one, then branch looks like
Branch A: Commit 3' <-- Commit 1
Commit 3'
includes commit 3 and commit 2 after rebasing.
Now if I run the command git diff commit3 commit3'
will it work ?
If yes, then why and what changes will it show in diff?
- If we delete the
commit 3
and just keepcommit 2
as latest master after rebasing. Then whatgit diff commit 3 commit 2
will show?
Note: here commit 3 has been deleted, how git will track this if found diff?