sourcetree whitespace issues

Hi guys, we're fighting with one of our repositories and just seeing a lot of really bizarre git (and/or source tree) issues with whitespace.

Here's what I know...

  • We're in windows environment
  • people are using different git clients (source tree, git bash, etc)
  • Seems to be an issue for some users and not for others

 

Symptoms include: files being marked modified when nothing has changed (aka whitespace / line ending issues).

So things I tried

  • git checkout –file ...  still files are modified
  • delete the file checking it out again - still show as modified modified
  • try stashing the files - still show as modified... 
  • git reset --hard  - same issue...

 

Any ideas? There's a lot of confusing information around this topic regarding auto=crlf - although i'm not sure I fully understand how to verify there are no issues.

 

Curious, does anyone have experience with this sort of issue? Any help you can provide?

Anyone use any companies out there that specialize in git source control that might be able to help? 

This issue is really frustrating and would really appreciate some help smile

 

Thanks!

1 answer

The cause of your problem is indeed the line endings. The people who have autocrlf=true are committing unix-style line-endings (while actually working with windows-style line endings) and the ones without this setting are committing a mix of unix-style and windows-style endings.

The solution is very simple: get everybody to set autocrlf=true in their Git configuration:

git config --global core.autocrlf true

and this problem will go away after a very short time. (You can expedite it by settings this yourself and committing all line-ending changes you have locally to all files.)

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

542 views 1 2
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you