I have problems with git using Xcode for my iOS project.
I'm using CocoaPods for my dependencies. Everytime I click "commit" I have some modified files listed (mainly from Pods directory) although I added Pods to my .gitignore and I did not make any changes to these files since the last commit.
Despite that they are always marked as "M" and ticked off even seconds after the last commit.
It is worth noting that I don't see any visible changes in the comparison view in those files.
Can someone please explain what happens and how to fix it?
Related
I am working on a project and need to see where I have made changes to a file-- these should be marked in blue but for some reason the changes only appear for some of the files, even though all are added. According to the documentation:
"When you add a new file or delete an unused file, you must commit
both the file and the Xcode project file (called project.pbxproj)
together for your project to remain in a consistent state."
But it is not clear to me where this file lives or how to include it in the commit.
The usual fixes (restart Xcode, restart computer...) have not helped and I have had to resort to the very messy procedure of using Time Machine to revert to a previous state.
I'm trying to commit ~9k files but I'm getting this error. I'm on Xcode 12.5.1.
There are some pods that I updated so lots of files were added and removed. Not sure if that is related to this issue.
This did not work
Committing and pushing through the terminal worked. After though, there was one more file that showed up in source control (in Xcode) with "!" next to it. I was done after I committed that one. Maybe that was what was stopping Xcode. If that was the problem, Xcode should make it more clear.
I thought it had something to do with me having so many files. But I was able to commit a batch of like ~1k files in Xcode.
I have an Xcode project using Xcode 8. I am using Swift if that helps/matters.
A few days ago after really not changing that much except a few funcs in one VC I tried to rerun my app and it had an error (I can't remember what it said unfortunately...but when I google'd it said basically that there was a file missing)
I located what the files were and just copied all changes into a blank project and deleted the file and pulled from Github a clean version and re adde the few funcs I added.
Everything was great and nice, until yesterday I noticed 2 yellow warnings.
I clicked the "Issue Navigator" and it is saying
TestApp project missing file
TestApp.debug.xcconfig is missing
Pods project missing file
pods - TestAPP.debug.xcconfig is missing
I realize that files just don't randomly disappear, but honestly I did not touch anything other than the Storyboard and the one ViewController File I am working on.
Why does Xcode keep deleting my files?
Is this project savable or do I need to start it over (is it corrupt?)
My project also is using Firebase.
xcconfig files are used to separate out build configuration information. Those errors are showing that you're missing entries corresponding to a debug build.
Nothing should be touching them. Only three possibilities come to mind:
You didn't create debug configs in the first place, but have tried to use them somehow.
Your path configurations are placing these in a directory that's getting wiped out when you clean/rebuild your app.
The project directory is under git control and you're doing something with git that removes the files.
Here's a screenshot showing I have two configs under my Pods project, one for "release" and one for "debug".
You might try setting up your project and making sure you see the debug configs listed. If so, see where they're kept and so on to diagnose what's going on. Otherwise, you just haven't created them.
My guess is that the files are not actually missing in any serious way. It's a bug related to use of git (as you say, the files came thru GitHub, so we know the project is tracked thru a git repository). The files were removed, but this is in fact not a problem. If that's right, then, as I explain at https://stackoverflow.com/a/39715083/341994, you can solve this simply by doing a git add or git commit of these files. That will cause Xcode to become happy and the warnings will go away.
I merged one of my branches into master through Xcode. As soon as I did, all of my files in the project navigator disappeared.
Git in terminal has run me through loops trying to revert back to a previous commit.
I am relatively new to git, so could someone please guide me through the correct process of A) retrieving my files, and (if someone feels like being incredibly helpful) B) properly adding/merging a branch into the master branch?
EDIT
The .xcodeproj file is still intact and usable with the correct files, it is the .xcworkspace file I have been using (as a result of cocoa pods) that no longer contains any of the appropriate files.
So within the .xcworkspace file, I can no longer access the scheme or find any of the files or utilize source control.
I had 2 submodules which I deleted recently. Removed them from .gitmodules, removed them from project directory, removed them from .git/modules. But Xcode still thinks that they're existing in Source Control. So I noticed an xccheckout file that contains the remotes. I googled about half of hour how to actually remove them, and found a single f...g instruction to remove them manually from xccheckout, others are about how to remove Git support from project (which isn't actually what I f...g need) or questions about should I put xccheckout into .gitignore or not.
Am I doing something wrong? Isn't there any way to remove the submodule link from Xcode project with actually the program created it? Am I the only who needs this?