SourceTree is showing thousands too many modified files in working copy

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

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.

 

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

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

573 views 1 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you