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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Version control of database schema (SQL DDLs in plain text file)

1.  Exported a database schema (only DDL) into to text file (.SQL)

2. initial Source tree commit. 

3. some minor schema changes 

4. exported database schema again

5. *** SourceTree complains "No changes in this file have been detected, or it is a binary file" 

I checked the gitignore_global.txt, it doesn't mention *.sql

Any suggestions what I an doing wrong ?




2 answers

0 votes
Ana Retamal Atlassian Team Aug 24, 2017

Hi Pavel! The extension alone isn't enough for Git to see if it's a text file, and the content might not include enough ascii character to guess it is text file either.

Typically, that happens because the file is being saved as something other than UTF-8. If it's been encoded in UCS-4, UTF-16, or UTF-32 it contains embedded NUL characters when using ASCII characters (and this is not text in the eyes of Git).

With the .gitattributes file you can explicitly specify that a .sql should be a text, not a binary. Just add a .gitattributes to your repository root folder and set the diff attribute to the paths or files. 

For more information you can read Git attributes and Customizing Git-Attributes.

Lastly, there's also a bug in our tracking system, you can follow it at SRCTREEWIN-5485.

Hope that helps!


Ana, thanks

I checked and the file is UTF-8 encoded. Will give .gitattributes a shot and revert shortly.



Still no luck. 

I placed on my Windows box in .git folder of my local repo

a file named "gitattributes" (L:\SourceTree\overload_database_structure\.git\gitattributes)

which contains

*.sql diff

Checking in pg_dump output with

--format=plain --encoding=utf8 --schema-only --compress=0 --dbname=overload  --host=XXXX --port=5432 --username=XXXX

does not produce desired result ( "No changes in this file have been detected, or it is a binary file" )

On the other hand created a .SQL with Notepad++ and it worked

Increasing Diff Size Limit (Text) in settings alleviated the problem. The dumps were 1Mb+ in size

Suggest an answer

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

[dev team] Sourcetree for Windows 2019 Preview - Dark Theme

Hi folks, While the full post is over on our blog I'd like to share the dark theme we've got planned for 2019 here directly as well to keep the discussion going.  The ...

3,280 views 19 18
Join discussion

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