How to use non-text documents, such as docx, exe, or zip with Bitbucket Data Center

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

There is often a need to keep all project-related objects, such as Requirements docs, presentations, source code and build executables within Bitbucket, and control their access. These files are typically documents with extensions docx, pptx, pdf or binary files such as exe, zip or tar.gz.

Solution

There is no built-in way in Bitbucket Server itself to recognize or manage these files. However, Git LFS offers commands to manage non-text files. It may not be possible to preview the files in Bitbucket UI. However, they can be downloaded. The files can also be locked using Git LFS locking API (since 6.3) and the locking previewed in UI (since 6.4).

Example:

  1. Install git-lfs on the client, if not already installed

  2. Initialize the repository location with LFS

    1 git lfs install
  3. Track your non-text documents with Git LFS

    1 git lfs track "*.docx"
  4. Commit

    1 2 3 git add .gitattributes git add *.docx git commit -m "DOCX files now tracked by Git LFS"
  5. Push changes to remote

    1 git push

See Git LFS for more information.

Updated on March 20, 2025

Still need help?

The Atlassian Community is here for you.