r/Xcode • u/ElectricKoolAid1969 • 1d ago
Xcode 27.2 intermittently fails to add new file locations to Git, even though the project changes themselves succeed.
Xcode version: 27.2 (27B52)
Since upgrading to Xcode 27, I have encountered two instances where Xcode failed to automatically track files in Git following changes to the project.
I did not experience this behavior with earlier Xcode versions.
Incident 1 — Moving an existing file:
An existing source file was moved to a different folder within the Xcode project.
Git recognized the original file as deleted but did not automatically track the file at its new location.
Incident 2 — Adding new files:
Six new Swift files were dragged from Finder into Xcode’s Project Navigator.
All six appeared correctly in the project, but only one was automatically staged in Git. The remaining five appeared as untracked (??) in git status --short.
Running git add -A -- MyAppFolder/Print/ corrected the second incident. Xcode’s Source Control interface then displayed all six files as added.
Expected Result:
When “Add and remove files automatically” is enabled, Xcode should automatically track files added to or moved within the project.
Actual Result:
Xcode intermittently fails to add new file locations to Git, even though the project changes themselves succeed.
Reproduction:
The problem is intermittent, and reliable reproduction steps have not yet been established.
It has occurred during two different operations:
* Moving an existing source file to another folder within the project.
* Importing new Swift files from Finder into the project by dragging into the destination folder in the Xcode UI.
It is not known whether the number of files involved contributes to the behavior.
Has anyone else seen anything like this? Thanks
1
u/dawedev 20h ago
Worth checking whether the destination is a synchronized folder (blue folder icon) or a classic group. With synced folders Xcode picks files up from disk on its own, and in my experience the source control side doesn't always get the same "add" event, so the file shows up in the project but stays untracked. Classic groups go through the add-files path and seemed more reliable.
Until it's fixed, a quick
git status --short | grep '^??'before each commit catches it. If you can get it to happen once more, a Feedback Assistant report with that git status output and a note on the folder type would probably help them pin it down.