By default, when Visual Studio writes a file, either in UTF-16 or UTF-8, it writes a byte order mark (BOM, U+FEFF) to the beginning of the file. This mark is required when using UTF-16, but it's widely considered a bad idea to write it in files with UTF-8.
Normally, a byte order mark is zero-width, so the likely reason you're seeing it in GitKraken and not SourceTree is because GitKraken explicitly shows it, whereas SourceTree probably does not.
If you're saving files as UTF-8 in Visual Studio, you need to save them manually as "UTF-8 without signature". If you save them using the default mode, it saves them with a BOM.
Alternatively, you can add an .editorconfig
file to your project which sets the default character set as utf-8
. That will direct Visual Studio not to write a BOM in your files. If your project is reticent to adopt such a file, you can create one yourself and ignore it by adding .editorconfig
to its own line in .git/info/exclude
.