Jonathan Solorzano
Jonathan Solorzano

Reputation: 7032

Error: pathspec did not match any file(s) known to git

I'm having problems to deal with Git repos, Cocoa Pods, and Xcode 9. After creating the Xcode project and added the pod frameworks I'm getting this error when trying to import into source control and Github:

The working copy of "ProjectX" failed to commit files.

error: pathspec 'path/to/pod/files' did not match any file(s) known to git.

I'm also having the same problem with an asset, but that one I can simply delete it and add it again.

How could I import to GitHub source control the whole workspace? Is it possible?

Note 1:

Just tried the following steps:

  1. Create an Xcode 9 project
  2. Installed Cocoa Pods to project
  3. Open Workspace
  4. Created project remote on GitHub
  5. Committed Cocoa Pods files

Everything works fine this way, but what if instead of creating the project remote after adding cocoa pods, we do it before? I did that and that way doesn't work.

Upvotes: 5

Views: 3215

Answers (2)

Jano
Jano

Reputation: 1

  1. move to your project folder/directory
  2. git status - you will get to know the changes done to your project
  3. git add .
  4. git commit -m"your message"
  5. git push origin master

Once you manually commit all the changes successfully from the terminal, then you can use source control in xcode.

Upvotes: 0

Joe
Joe

Reputation: 4074

This may be a case issue try running below command to change git case setting and then your commit file after this.

 git config core.ignorecase false --global

or try by below one if above one doesn't work

 git commit -m "<commit message>" <project directory path>

Upvotes: 5

Related Questions