Skip to content

Provide a way to checkout old versions of a merge request

It's nice that gitlab provides a way to diff the different versions of a merge request (e.g. version 3 with version 2), but sometimes I want to check out version 2 locally.

It's also nice that gitlab provides a way to check out merge requests via the refs/merge-requests directory (i.e. refs/merge-requests/1/head)

Could you add the old versions of a merge request as refs inside refs/merge-requests/<merge request>/?

Something like refs/merge-requests/<merge request>/v<version> ?

As a workaround I set

[uploadpack]
        allowAnySHA1InWant = true

in the repo's git config on the server.

And then I could checkout the commit hash corresponding to version 2 (since there was no longer a branch associated with it).