Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode commit missing file or directory

I'm not sure what happen but when I try to commit my changes in Xcode I get an

fatal: Could not switch to '/Users/charlesbutler/xCode/MA Mobile/MA MobileTests': No such file or directory

I have a bunch of files like this.

Is there anything I can do to remove them from being committed. A lot of them were deleted (probably manually in the project folder by me)

like image 597
Hackmodford Avatar asked Nov 29 '11 20:11

Hackmodford


People also ask

How do I add missing files to Xcode?

Select all the missing files that are in one folder in Finder. Click the choose file button; it is under the Location drop down menu; it is an image that looks like a very small window with a document inside it. A Choose folder containing the selected references sheet should appear. Save this answer.

How do I add files to a commit?

To add and commit files to a Git repository Create your new files or edit existing files in your local project directory. Enter git add --all at the command line prompt in your local project directory to add the files or changes to the repository. Enter git status to see the changes to be committed.

How do I see commits in Xcode?

Open the Source Control navigator. In the Repositories navigator, expand your repository and the Branches folder. Select a branch to display a list of commits. Double-click a specific commit to display the comparison view, and see additional information about the commit in the Source Control inspector.

Can you commit without add?

Without adding any files, the command git commit won't work. Git only looks to the staging area to find out what to commit. Staging, or adding, files, is possible through the command line, and also possible with most Git interfaces like GitHub Desktop by selecting the lines or files that you'd like to stage.


1 Answers

This just happened to me. I had deleted a folder with contents from the project folder. Xcode didn't handle that well.

What worked to fix it was to recreate an empty folder with the same name. No need to recreate its contents.

In your case I think you just need to create a new empty "MA Mobile" folder in the same location the old one was. Then commit. It worked for me.

After the first commit I deleted the new folder, then committed again. It seems that Xcode is missing the logic to handle the deletion of a whole folder with contents.

like image 115
Joshua Goossen Avatar answered Sep 30 '22 02:09

Joshua Goossen