I started work on a new project and found I had the following when I launched Xcode:
Changes not staged for commit:
modified: <project>.xccheckout
and
Untracked files:
<project>/xcshareddata/
I then edited .gitignore
to ignore .xccheckout
and checked the status. It now read as follows:
Changes not staged for commit:
modified: .gitignore
modified: <project>.xccheckout
i.e. the Untracked files mentioned previously were no longer being output by git. I've tried this several times and it's completely reproducible - but completely inexplicable.
Something to keep in mind about
.gitignore
is that files that are already tracked/added aren't affected by it. And it looks like your<project>.xccheckout
is already git-versioned.To trick git into assuming that thist file is committed but remain unchanged you can do:
To reverse:
As for
<project>/xcshareddata/
, I assume there are.xccheckout
files in there that are untracked by git. Hence, after your.gitignore
is introduced, git ignores all of them.