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

sourcetree whitespace issues

Shaunt Kojabashian June 16, 2015

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

0 votes
Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 16, 2015

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
TAGS
AUG Leaders

Atlassian Community Events