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.
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
see the comment to Kieran. What you say may be true, but command line git and sourcetree dont' agree on the file status.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.