SourceTree is showing thousands too many modified files in working copy

Thomas Dahlquist December 18, 2014

Hi!

I'm really new to Git and SourceTree but it has worked OK until now. For some reason SourceTree is showing 2500+ modified files in my working copy although I have only modified 10 or so. If I view of the unchanged files in Finder I can also see it hasn't been modified for days.

Is there some way to ignore all these files in bulk without deleting or reverting them and maybe let SourceTree find the actual changes when I then re-save the files I want to commit?

I recently made some read/write updates with chmod -R 777 on some of the folders in my local copy, could that have something to do with it? I'm using SourceTree 2.0.3 on OS X Yosemite 10.10.

1 answer

1 accepted

2 votes
Answer accepted
Robert Glover December 19, 2014

I am able to recreate what happened to you this way:

  1. chmod 777 someDirectory
  2. ("git status" shows no change)
  3. chmod 777 foo.txt
  4. git status shows: 

    "modified:   foo.txt"

So the problem is not that you did chmod on directories, it's that you did it on files.
Here is a solution that will work:
  1. copy the files you really modified to a non-git scratch directory
  2. git reset --hard HEAD
  3. copy the files you really modified back into the git working directory
  4. note that the "git reset --hard HEAD" will undo all those chmod's that you did.

 

Thomas Dahlquist December 19, 2014

That worked great, thanks a lot for taking the time!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events