History of no longer visible commits

I’m using Gitlab API [https://docs.gitlab.com/ee/api/repository_files.html#get-raw-file-from-repository](http://Gitlab API) to obtain the history of a file for a specific commit using the following path:

I want to get a version of a file that was valid at the moment of placing a comment (in this file) in a merge request. However if during the merge all commits from a branch are squashed or the history is overwritten in other way the data are not available anymore after some time. Also when we go on the website to a historical merge request the information about differences for such cases is not available and we see the message

No changes between branchA and branchB

From my investigation it seems that the history (for removed / squashed commits) is available for 6 months, which is not ideal. Ideally I’d like to extract all history.

Could you please tell me:

  • Is is possible to get all history in other way?
  • Is is possible to change the settings for the whole organisation to store more than 6 months of a history?