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

Matthew Grasse Jul 09, 2013

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

0 votes
Answer 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?

Cheers

Matthew Grasse Jul 10, 2013

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?

Matthew Grasse Jul 16, 2013

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.

0 votes
Steve Streeting Jul 10, 2013

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.

Matthew Grasse Jul 10, 2013

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

Steve Streeting Jul 10, 2013

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
This widget could not be displayed.
This widget could not be displayed.
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 ...

1,913 views 14 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