How can I find out what are the differences between 2 remote branches?
I tried:
git diff --name-status remotes/branch-V4.4..remotes/branch-V4.2
But it gives me a list of files which changes. Is there a way I get a list of commits which shows me the difference between 2 branches?
Thank you.
Update:
Thank you for the answer. I have tried 'git log --graph remotes/branch-V4.4...remotes/branch-V4.2'
I see
* commit ............
|
|
|
* commit .............
|
|
|
* commit .............|
|
|
* commit .............
Why only "|" , a straight line? why it does not show where does the 2 branches begins to diverge?
Thank you.
You can git branch -a to list all branches (local and remote) and then choose the branch name from the list (just remove remotes/ from the remote branch name. Example: git diff main origin/main (where "main" is the local main branch and "origin/main" is a remote, namely the origin and main branch.)
Another way to do this is to right-click on a branch and select the "Diff against current" context menu command (current refers to the branch you are currently working on). This will give you the diff between the head commits of the two branches.
What you are looking for is probably something like:
gitk --left-right remotes/branch-V4.4...remotes/branch-V4.2
or if gitk is not available:
git log --oneline --graph --decorate --left-right --boundary --date-order remotes/branch-V4.4...remotes/branch-V4.2
You might also want to try it without the --date-order
, but especially in complicated situations, I found that git log
produces more useful graphs with that option.
Every commit in that graph will be either marked with <
, >
or o
- that means that they are part of the left branch, the right branch or a “boundary commit”.
Use git log
instead of git diff
:
git log remotes/branch-V4.4..remotes/branch-V4.2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With