Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Sourcetree diff is very slow on ipynb files

Neznakomec
May 16, 2026

Hello, I tried different versions of SourceTree for Windows (3.4.30 and 3.4.23 an older one),

and I see that when I'm clicking on some *.ipynb file in git commit, I have a very slow processing it to show lines with code changes. And the whole app is hanging 1-2 min while diff is not shown.

 

--

Probably it's related to particular repository and corresponding git setttings:

https://github.com/lysukhin/vk-academy-dl-cv

--

Just a guess, maybe it's related to the fact repository created on Mac,

but I'm working with it on Windows, and also I have

core.autocrlf = true

 

Maybe it's all very slow because of different line endings. (external utility) DiffMerge also very slow in processing diff to ipynb files in that repository

 

3 answers

1 accepted

3 votes
Answer accepted
Tomislav Tobijas
Community Champion
May 16, 2026

Hey @Neznakomec ,

I'm not that familiar with Jupyter Notebooks, but it would probably depend on how large these JSON files are. From what I've found, .ipynb files often contain long, single-line strings of metadata and Sourcetree's diff engine probably attempts to process these as standard text. But then a single line or the raw diff data exceeds certain thresholds and the application can hang. 

core.autocrlf = true > this should be correct (Git to convert LF to CRLF), but this can also force Sourcetree to calculate a diff for the entire file, rather than just the modified code. 🫤 

What you could try (I've only found this and not tested it):

To prevent Sourcetree from attempting to render these complex diffs, tell Git to treat them as binary files.

  • Create or edit a .gitattributes file in your repository root.

  • Add the line: *.ipynb -diff

  • This will stop Sourcetree from hanging, as it will no longer try to generate a text-based diff for these files

Or you can try to use a specialized diff tool or optimize Git config. 👀

But this is a bit out of my 'domain' - potentially someone worked more with .ipynb files and could share some insights.

Cheers,
Tobi

Neznakomec
May 16, 2026

Thank you Tobi, probably it's the best solution (to ignore ipynb files ONLY IN THAT repository)

 

Probably this particular repository had a problem
because of different (Windows and Mac) line endings or because IPYNB files shrinked to one-line JSON or smth like that...

Like • Tomislav Tobijas likes this
Tomislav Tobijas
Community Champion
May 16, 2026

Glad it helped! 😊

Yeah, in that case, ignoring only *.ipynb files in this repository sounds like the safest workaround. If you still need to compare notebook changes later, maybe a dedicated notebook diff tool would be a better option than relying on Sourcetree’s default diff view.

Like • Arkadiusz Wroblewski likes this
0 votes
Arkadiusz Wroblewski
Community Champion
May 16, 2026

Hello @Tomislav Tobijas  and @Neznakomec 

Maybe Nbdime. 

0 votes
Neznakomec
May 16, 2026

.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events