Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

I can't see the diff. It incorrectly says "No changes in this file have been detected"

Caleb Rader
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 28, 2017

Untitled.png

6 answers

12 votes
bgannin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 29, 2017

Have you tried increasing the size of the files supported in the Diff settings tab? It may be too large for preview based on the defaults.

starscr3am77
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 26, 2018

This worked for me, thanks!!!

Deleted user November 23, 2018

Thanks, worked for me as well!

vfadaman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 21, 2022

thanks. it works.

daguajar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 6, 2024

Thanks a lot, it works for me too!

0 votes
Brian Gale July 12, 2023

Just wanted to throw in my "troubleshooting" steps and my suggestion to the Atlassian team for this.

Suggestion - have a mouseover on the text "File patterns" that would tell you which setting is causing it to be ignored. Is it the file type, the file size, file name, something else. Also include where to fix the problem. Is it in the Sourcetree config OR the gitignore file or something else.

Troubeshooting - The tip from minnsey about "git diff" is how I determined that it wasn't a "git" config issue but a Sourcetree config issue was that I ran git diff on the file. Easy to do by clicking on Terminal in the top right corner, then change to the directory with the file you want to compare (cd <path to file>) then do a git diff on the file (git diff <filename>). If this succeeds, then it is LIKELY a Sourcetree configuration issue. If it fails, then it is likely a git related issue (file isn't tracked, file is ignored, file is a binary file, etc).

0 votes
Александр Савиных
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 7, 2022

Hello

I get buggy behavior in SourceTree. When I compare two branches, it says: No changes in this file have been detected, or it is a binary file or it is configured to be ignored by the File patterns

None of the conditions listed in the error message are true for my file. There are changes. It is a text file. The file is not ignored.

There are just 1821 lines in my file. 🐞🐞🐞 

0 votes
Rod Dewell
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 29, 2021

Aside from the size limit another reason for this message is that the file is encoded with UTF-16.  Atlassian SourceTree does not properly recognize unicode and UTF-16 files as text which makes them unviewable and uncomparable under SourceTree (specifically git diff).

If the file suffix of the UTF-16 files is known (*.uni for example) then all files with that suffix can be associated with UTF-16 to UTF-8 converter with the following two changes:

  1. Create or modify the .gitattributes file in the root directory of the repository with the following line:

     *.uni diff=utf16
  2. Then modify the .gitconfig file in the users home directory (C:\Users\yourusername\.gitconfig) with the following section:

    [diff=utf16]
        textconv = "iconv -f utf-16 -t utf-8"

These two changes should take effect immediately without reloading the repository into SourceTree. It applies the text conversion to all *.uni files which makes them viewable and comparable like other text files. If other files need this conversion you can add additional lines to the .gitattributes file. (If the designated file(s) are NOT UTF-16 you will get unreadable results for that file.)

The conversion process is invisible and does not affect or touch the file itself.

vfadaman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 21, 2022

It works. thanks.

0 votes
David Badham
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 18, 2020

The size limit in the diff tab fixed it for me also. This is really invisible. Please show this is the issue in the UI when the diff does not show since it just looks like it is treating it as Binary at the moment.

0 votes
minnsey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 29, 2017

Hi

Ultimately Sourcetree relies on the 'git diff' command for that information. Typically you will see that if the file is binary or encoded as something other than ASCII.

You can see what git thinks the diff is by opening the Terminal and running git diff against that file. See https://git-scm.com/docs/git-diff

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events