XCode Won't Commit To GIT - xcode

Been googling for a while with no luck.
I have been working on my app for a week and I'm trying to commit to git now, so I can start branching and try some new stuff. But I can't commit my changes. I get the following message:
"The working copy "APP NAME" failed to commit files.
fatal: Could not switch to '/Users/Leonne/Documents/iOS Projects/APP NAME/APP NAME/Resources': No such file or directory"
I have initialized the git repository. I don't understand what could be going on.
Before, I did create a "Resources" folder, but deleted it afterwards. I never committed with the existence of this "Resources" folder. I deleted the Resources folder because it was giving me troubles whenever I tried to compile my app. I'm working with XCode 4.4.
Any help will be appreciated.

Ok, I just experienced this problem today morning. I don't know if mine is THE perfect fix. My Mac crashed and I restarted, and I could commit again.
If my fix hold true with you as well, then it could be a bug with XCode.
Edited
It seem my error still exists and the following is my fix.
It seem Xcode GUI have some problem with using GIT properly. So i used the terminal to do this. I went to the working directory and then did a git status this will show you a list of files that were deleted/modified/added. You can manually add them all together using git add or just a straight git commit -a (not recommended on complex projects)
This solved the commit issues and when i went to Xcode, the error doesn't seem to exists anymore

Looks like I have the bad habit of solving my hour-long problems 5 minutes after I post about them on StackOverflow, haha.
My fix was rather easy. I navigated to the specified route and re created the Resources folder. I added the folder to my project via XCode's "add files" feature. Directly afterwards I deleted it from there, moving it to trash. Now I can compile and commit, thank goodness.

Related

Xcode Failed to Commit Files: "Communication with the service was interrupted"

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.

Can`t see the file history in Gitlens (on a specific project)

I have a problem with Gitlens extension. Firstly, Gitlens or Git History extension is working fine on any other project except the this Laravel project. My problem is, can`t see the file history or line history in this project.
On the other hand, there is no problem in the git log (Git History Extension) as seen in screenshot;
But I can't compare any files with their any version (every commit seems like in the ss). I have no idea what the problem is about.
Lastly, I don't think the problem is about extension settings because other projects do not have this problem. Is there a any chance to fix this issue without resetting git history?
I am answering after 3 months, maybe it works for someone. As I mentioned in the title, surely there is no problem about extension settings for this specific project. The problem is just about git files. Maybe, I damaged some git files while moving the project on my desktop :)
So, there is no chance to fix this issue without resetting git history or starting fresh with git, if you`re having the same problem.
Do not play with git files, it`s no joke!
I've got a similar issue. My problem is in using symbolic links for folders.
I have this folder symlink for my repos.
C:\>dir
Directory of C:\
27.09.2018 21:07 <JUNCTION> repos [C:\Users\Qwerty\repos]
(GitLens v11)
The top editor is opened via C:\repos
The bottom editor via C:\Users\Qwerty\repos
You can see that some git features still work (yellow), but others don't.
However, this is very strange, because in my other repos, I have never observed such issues.
Also notice below that it is still possible to invoke the same action via a git lens popup and then it is possible to use the Prev Next Revision buttons.
Anyway, after more testing, I actually observe the same thing in my other repos. I assume that something must have changed between versions as I only observe these issues for last maybe 2-3 months. I even submitted a ticket that GitLens stopped working in v12.0.0 and later versions https://github.com/gitkraken/vscode-gitlens/issues/1979
The buttons completely disappeared and even the commit information
v11
v12
And Now actually, after having reopened my repo via original path and after updating GitLens back to v12.0.6 I see that it is working properly!
Bottom editor is opened via C:\repos symlink.

XCode - my project is empty after I restart my Mac

I got this very weird problems these days on XCode (8.3.2 8E2002):
My XCode project is working well with Bitbucket source control. Some days ago, after booting up my Mac, all files in my project are gone, its project folder name became <myprojectname> (1). Then I cloned it from Bitbucket and was able to work on it, committed, ...
I find that every time I restart my machine, the symptom comes back and I have to redo cloning from Bitbucket, work, commit, ...
Previous XCode versions never had this kind of issue before. Has anyone got it? What's wrong with my XCode/Bitbucket? How can I fix it?
Thanks

Xcode keeps deleting 2 files

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.

Xcode SVN commit error

this is driving me nuts. My SVN repo is working fine, I was able to checkout everything and view revisions in Xcode's organiser.
It is only when I go to commit the changes that i hit this ridiculous problem:
After a lot of research I found the only people getting this problem were those who didn't realise that there is a separate password for google code than your google account password. My password is correct.
Does anyone have any ideas? Thanks a lot
As it turns out, this is due to some bug in Xcode I think. What you have to do to get around it is:
Firstly set up your repository in Organiser
Open the project in Xcode and make a change
Try to commit this change in Xcode. You will get the error above
Now commit the change to your repository using the svn command in the terminal
Now make another change and commit it using Xcode. It will work

Resources