-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
show commits difference between 2 branches (git log branchA...branchB) #3792
Comments
This exists for the most commonly needed special cases, but not for any two branches. For the divergence from a branch's upstream, type Is this what you were looking for, or do you have workflows that require more than this? |
@stefanhaller Thanks for the info on how to see branch divergence from the upstream branch. What I am requesting is a different feature, which is to compare the commits of any two branches. This workflow comes up when there is a feature branch or some project-specific branch of a main branch that needs to be compared back to the main branch. (PyCharm allows you to do this for example.) One suggest for implementation would be to add an option that when a branch is selected pressing a key will compare its log with the checked out branch. |
@stefanhaller when I press |
@insane-dreamer what version of |
@mark2185 was using 0.40. Upgraded to latest version and see the new menu/keybinding. Thanks. |
@insane-dreamer Can we close this then, or are there still situations where the current feature set is not sufficient? |
@stefanhaller so my requested feature is not addressed by the ability to compare a local branch with its upstream (which is useful in itself but a separate use case). Rather, what I was suggesting was the ability to select a branch in the list of branches and then compare the logs for that branch against the checked out branch. This could be equivalent of running, for example, Or alternatively, one could select any two branches (or tags) in the branch list and press a key to compare those two (regardless of the checked out branch, since |
Yes, I got that. My question was more if you ever need to do this against a branch other than main. Did you see lazygit's I'd be curious about the use cases where you need to do this for any two branches, not against either main or upstream. |
Understood. To answer your question, it's not uncommon, in our use case, to need to compare two branches neither of which is |
See, that's what I suspected. In this case you probably want to configure that release branch as one of your main branches, using the Any others? |
The other case is when you have to compare branches of code between different platforms. But in theory that could be solved by tagging those branches as |
Actually I tried adding branches to |
It always picks the closest one, which is generally what you want when you have, e.g.,
This is not a problem in practice; you can set the config to the union of all the main branches that you have across all your repos, it will ignore the ones that don't exist in a given repo. Alternatively, we now have per-repo config files (not released yet, though), so this would be a way to configure main branches per repo if you really want to. But overall, abusing the mainBranches config for cases where you want to diff against something that isn't really a main branch is probably not a good idea. |
This is possible with a custom command of course, but it would be nice to be able to select 2 branches in the Branches panel, press a key and the diff list of commits is shown in the commits panel, which can then be navigated and inspected as usual.
(Maybe this exists but I couldn't find it anywhere.)
The text was updated successfully, but these errors were encountered: