David Seek
David Seek

Reputation: 17132

How to solve: Xcode shows files still as modified after commit

I am using SourceTree as a git client.

A while ago, I had a major problem with my project and my git, so I had to reactivate a copy of my workspace from an external source. For that purpose I had created a complete new repository. Commiting to that now.

Today I've noticed, that most of my files appear as "modified" in Xcode. Even after commit and push (with SourceTree).

enter image description here

Source Control shows my two branches, what is correct:

enter image description here

And the History shows perfectly all the commits:

enter image description here

My feeling tells me, that in the background the old repository information is still present and does this bug. How do I handle this? Help is very appreciated.

Edit:

git diff --ws-error-highlight=new,old Output

enter image description here

Upvotes: 5

Views: 3546

Answers (3)

Deveesh
Deveesh

Reputation: 129

This worked for me:

  1. Delete derived data folder(Steps: Click Xcode on top left -> Preferences -> Locations -> Click on the right arrow below Derived Data and that will you take you to the Derived Data folder in Finder. Delete it)
  2. Quit Xcode (Don't just close the project)
  3. Reopen Xcode

Upvotes: 4

Andy Weinstein
Andy Weinstein

Reputation: 2725

Close Xcode. If you can avoid it, don't reopen Xcode :-) If it's an absolute must, reopen Xcode. The M markers should be gone.

Upvotes: 6

VonC
VonC

Reputation: 1325137

Check if the nature of the diff is related to eol (end of lines).
See "git diff - show me line ending changes?", like:

 git diff --ws-error-highlight=new,old     

If that is the case, try first:

 git config --global core.autocrlf false

Then try again to clone your repo, and see if XCode still display those differences.

In your case, this is not about eol, but about an update done in your files.

Check for any .gitattributes file: is there a smudge directive in those files (which would explain an automatic process taking place on checkout)

See Keyword expansion for an example of smudge script.

Something seems to update JTAppleCalendar to its latest relase (6.0.1 from 7 days ago)

My feeling tells me, that in the background the old repository information is still present and does this bug.

Simply try, in command-line, to clone again that repo (in a brand new local path) and check if the issue persists in that new cloned repo.

to the JTAppleCalendar, I have changed from 6.0.0 to 6.0.1 manually. around 7 days ago. when the new xcode 8.0.1 arrived

In that case, all those files should be listed as modified: that is what Git does.

Upvotes: 2

Related Questions