In my git repository opened with SourceTree I see a lot (maybe all the files I have in the project) appearing in Working Copy Changes ares.
If I select any of these I can see on right side that there are only diffs regarding whitespaces. The issue is how I can discard all these "changes"? Ctrl+a to select all and pressing Discard still keeps them there...
Is this on Windows? If so what is the 'core.autocrlf' setting in your core .gitconfig?
For best management of line ending on windows, this should be set to 'true'. SourceTree defaults to setting that for you in the setup wizard, unless you uncheck the box to automatically handle line endings.
Yes, I am on Windows and I have this in my git.config:
1
2
3
4
|
[apply] whitespace = nowarn [core] autocrlf = true |
Sometimes "discarding" of these files works after a few tries, sometimes not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My best guess is that the files in question were committed by someone who had autocrlf=false, which means they ended up in the repo with extra CRs in them. The autcrlf option (and the equivalent .gitattributes settings) is a transform and works great, but only so long as it's applied consistently, once there's a mismatch in the repo you can only fix it by re-committing the files affected with the correct setting. So re-committing these files would probably fix it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry to re-open this thread, but I also have this exact issue and haven't been able to resolve it. It may well be a result of previously using the repository or someone making commits with the wrong autocrlf. My problem is that I can't re-commit the files to fix it.
All files in the repository are listed in the Working Copy Changes with green ticks, but I can't stage any of them (it does nothing), and I can't discard them (the option is greyed out). How do I remove these files from the list of Working Copy Changes? My command-line git behaves correctly and doesn't list any of these files when running git status.
Both my global .gitconfig and the one in the repository now has autocrlf=true. I've tried removing the repository and re-adding. I've tried both system git and embedded git. I've tried re-starting SourceTree. What action can I take to remove all the green-ticked files from the Working Copy Changes?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had the file in the "staging" area with green checks next to them. Tried all the advice here. Then I restarted SourceTree and they went away and I could complete the merge properly.
Hope that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same behavior, and to me it looks like a bug in SourceTree.
Right now I have the following setup.
This scenario works:
this scenario does not work:
But, under File Status and Log / History, the list "Working Copy Changes" is populated with a lot of incorrect files marked as unmodified. The one file that is actually changed is also present in the list but marked as "unmodified" instead of changed. I think that it may be ALL the tracked files in my repo (not the files in gitignore)
SourceTree just got very hard to work with.
I have tried to remove my local repo entirely, remove the bookmark in SourceTree and clone the repo again, but the error persists..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@James: Unfortunately it doesn't work for me.
We have files (mostly build and configuration files) being tracked by git. More than one 100 of the show the green tick and a 'Clean' tooltip if you hover over them. There is no way to get rid of them beside using 'Stop tracking' and commiting them in SourceTree.
However... It's completely misleading because in the git command line (wheter I use the one from source tree or the one for github) shows no files when I run 'git status'. We have a team here that started with git only a couple weeks ago and they are VERY confused seeing these files.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was helping someone with this issue before and found that the answer is simple but unintuitive.
Git is keeping track of a file in your repo called .git/index which holds the status of your files. That file also keeps track of if file conversions happened to those files for autocrlf. If you already cloned and checked out your repo before you set your autocrlf setting, then it will show warnings for crlf>lf conversion and give you those unmodified files lines.
The way around it is to delete that .git/index file and manually run a git reset command to let git figure things out again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Steve,
Yes, I am on Windows and I have this in my git.config:
[apply] whitespace = nowarn [core] autocrlf = true
Sometimes "discarding" of these files works after a few tries, sometimes not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.