Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab diff between commits... how does this work?

I need to get a diff between two commits in GitLab. I've read the instructions for doing that, but they aren't consistent with GitLab's diff form.

I have to specify the name of the "to" project (the "from" project is pegged to the current project) and the "from" and "to" commits. But when I select Repository > Compare I get this:

GitLab commit diff

The form prompts me for the name of the "to" project and "from" and "to" branches. There's no place to select the "from" and "to" commits!

Could I have displayed a form that's just for comparing the latest commits of different branches, even though I followed instructions for comparing different commits of the selected branch? I don't think so; the last button is labeled "Swap revisions," not "Swap branches." The form thinks it's inviting me to select two commits, but doesn't let me do it.

I tried entering commit IDs in the "branch" fields. GitLab won't let me. The fields are dropdowns. They let me enter a value, but it's just a filter for a list of branch names; when I enter a commit ID GitLab finds no matching branches and I can't select anything.

How is this supposed to work?

like image 222
Jonathan Sachs Avatar asked Aug 02 '26 09:08

Jonathan Sachs


1 Answers

It is a bit confusing, but in the dropdown there is a field that you can use to filter your branch. In that field, you can enter the SHA of the commit, and press enter. In this way, you can compare commits

enter image description here

like image 53
rpadovani Avatar answered Aug 07 '26 13:08

rpadovani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!