Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Sourcetree diff not working; displaying wrong add/substract and wrong linenumbers


I overwrote a .tex file with another version of it. The version on disk is now exactly as i want it. Sourcetree is showing the file as altered, but not all alterations are shown, and some nonexistent alterations are shown. Additionally the line-numbering is off.

See attached Screenshot: (yellow highlighted regions)

I opened the file in Notepad++ to show the real content, and you can see in the background the Sourcetree diff, with wrong line numbering (observe that the real /begin->/end block is four lines from 40 to 43 and the Sourcetree diff is a weird /begin->/end/end block) and, very importantly: A line that does not exist anymore (Sourcetree line 36) is not marked as missing!

I tried commiting, the commit works with the real file, and also reverts fine, but the shown diff is always wrong. Altering stuff in N++ and saving resulted in a still wrong diff, that some times showed a +/- of lines that were unaltered and mostly showed the altered line (i experimented with the Windows 8 line ) as unaltered.

A diff using the diff tool from TortoiseGit was normal and correct.

Just to be clear: I doublechecked that N++ and Sourcetree are seeing the same file, by altering it in N++ and seeing the file change in Sourcetree - so this is not about looking at different files, this is some bug(?) in the ST-Diff (not the actual storing of files, just the showing of the differences)

Anybody know what causes this? It is very disconcerting to not be able to trust the diff.Sourcetree-Problem.png

Screenshot from Bitbucket, of older version of the file, with "Windows 8" line as part (?) of Line 33 ??

BitBucket old source of system_requirements.tex.png


1 answer

1 accepted

0 votes
Answer accepted
bgannin Atlassian Team May 23, 2018

Hi Andre,

This is an excellent bug report. Please file these details in our public tracker,, and we'll take it from there.


Brian Ganninger
Product Manager, Sourcetree

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

7,025 views 5 13
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you