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

Sourctree reports modified files after clone

I'm having a problem where after I do a clone sourcetree is telling me that I have modified files even though I haven't yet edited any code. When diffing the code, the differences seem to be whitespace only. I'm pretty sure that the difference is related to line endings.

The files in questions are all of a type that have 'eol=crlf' set in .gitattributes.

What's confusing to me is that doing a 'git status' in the git bash does not report any modified files. Generally I'd believe that we might have some line ending issues in the repo, but I can't understand why sourcetree and the command line tools are treating the working area differently.

Any advice on how to resolve this issue? I've seen similar questions in here, but they seem to be regarding hg and not git.

2 answers

1 accepted

Hi Matthew,

There's probably another property set in your git config which is affecting what happens on checkout. For example the 'text' attribute has an effect on checkout and will normalise line-endings automatically. Have you got any 'text' or 'autocrlf' settings in your config?


autocrfl is true. But I still don't understand why the command line git and Sourcetree don't agree on the files status. Aren't they using the same config?

I cleaned out my area and redid my checkout. Now I can't reproduce my disagreement between the command line tools and sourcetree. I did do an upgrade when this showed up, could there have been some issue around a repo that was checked out with the old version?

Anyway, CRLF issues are definitely one of my problems, so I'm marking an answer regarding those issues.

It means these files were committed to the repo in a way which didn't perform the line ending conversion that your client setup would now do. They show as modified because you're being prompted to re-commit them, which will perform the line ending conversion as *currently* configured and resolve the issue.

see the comment to Kieran. What you say may be true, but command line git and sourcetree dont' agree on the file status.

What git command are you issuing? SourceTree just issues 'git status', with these options with the default filter:

git status --porcelain --ignore-submodules=dirty --untracked-files=all

As you say, it picks up all the same config as git on the command line because that's exactly what it's calling.

Suggest an answer

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

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

960 views 0 9
Read article

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