How to disable delta compression on Bitbucket Server server for a particular file type
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Git is notoriously bad at handling binary files. This is one step you can take to manage large repositories made up from code bases that have to track huge binary assets. For binary files that change significantly – and not just some meta data headers – the delta compression is probably going to be useless so the suggestion is to turn delta off for those files to avoid the unnecessary delta compression work as part of the repack.
Solution
Resolution
Find the repo ID number by going to repository settings of the repo you would like to add this parameter to. There you will find the "Location on disk".
Edit the
.gitattributes
file in<Bitbucket Server_Home>/data/repositories/<repo_ID_number>/info/attributes/.gitattributes
. If the directory and file do not exist please create them.Add the following line to the
.gitattributes
.
Disable Compression of .jpg Files
1
*.jpg binary -delta
Checkout this page for more information on .gitattributes
.
Related Content
Please read this blog for more information on how to handle big repositories.
Was this helpful?