Not sure why this is happening or how to stop it but it is making it very difficult to commit the actual changes I want.
From your screenshot, it looks like all the changes are in the Pods
directory, suggesting that you're probably running Cocoapods commands that install and/or update your cocoapods, e.g. pod install
or pod update
. As a dependency manager, the job of the pod
command is to manage the third party components that you've installed in your project, so it's no surprise that that command changes files in your project as those components are updated.
There are at least two ways to manage those changes, both of which are fully described on cocoapods.org. In a nutshell, you can:
ignore the Pods
directory: Set up your .gitignore file so that git ignores the Pods
directory. All the information you need to reproduce a given configuration of your project is stored in the Podfile
and Podfile.lock
files (which are stored outside of Pods
), so there's no need to commit all the files belonging to all the pods to your source repo.
don't run commands that update pods: You can go ahead and track all the files in Pods
if you want to, e.g. if you're worried that some of the pods you need might disappear and prevent you from building your project. If you do, you need to be aware that running any pod
commands that update the installed pods may change any of the files in Pods
, so you'll need to avoid running them except at those times when you specifically want to update the installed pods.
Update: After I posted the above answer, you commented to say that more files are affected than just those in your Pods
directory, and you added another image. That image shows that the affected files have .icloud
file extensions, which suggests that the files are being stored in iCloud rather than on your local drive; the files ending in .icloud
are placeholders for files that haven't been downloaded to your computer. To avoid that, ensure that your project directory exists locally rather than on some iCloud volume.