File detected as binary, not displayed as text in Bitbucket


アトラシアン コミュニティをご利用ください。



Bitbucket will display the contents of all plain text files when git detects them as not binary.  If you have a file that should display in Bitbucket and it does not, this can sometimes happen when git looks in the first few bytes of the file for null characters or non ascii characters.  When this happens Bitbucket Server will not display the file and will offer a download link instead.  You can confirm if this is the case by using vi or hexdump.  Here is an example:

Text File:

$ hexdump text.xml
0000000 3c 70 72 6f 70 65 72 74 69 65 73 3e 3c 2f 70 72
0000010 6f 70 65 72 74 69 65 73 3e 0a

This file will be detected as binary:

$ hexdump bin.xml
0000000 00 3c 70 72 6f 70 65 72 74 69 65 73 3e 3c 2f 70
0000010 72 6f 70 65 72 74 69 65 73 3e 0a

cat will not show this blank byte at the start of the file:

$ cat bin.xml

vi will show it like this:



  • Delete the characters in the file with vi that causes git to report it as binary.
  • Push the updated file to Bitbucket Server in a new commit.
  • Confirm the file can be viewed as text not binary in Bitbucket.


最終更新日 2017 年 4 月 18 日


Powered by Confluence and Scroll Viewport.