Clone repo from github to xcode issues

Viewed 3978

I have tried following a few tutorials on cloning a github repo and opening it up on xcode. I first connected my github account to xcode and then I selected a project to clone. I then placed it into my folder where all my projects are stored. Then I went to xcode to open an existing project but when I try to select the project I cloned I get this message:

Could not open file. (/Users/username/Documents/Dev/Linked-Lists)

I am not sure what the issue is. Here is the url I am trying to clone: https://github.com/wwolfgang11/Linked-Lists

From what I found online, once I clone an existing repository and save it either my desktop or some folder, then Xcode should automatically open up the project. In my case that does not happen and I have no idea why.

3 Answers

This is because the folder is not an Xcode project. Xcode project files are folders(bundles) and Xcode will think that the folder is a project and fail to open it. And the repository doesn't contain any .xcodeproj files.

SmileyCreations identified the problem (the repo doesn't have an Xcode project), so here's how to solve it:

1) Create a new "macOS" project and set it to be a command line tool: 1 create new project 2) Choose the C++ language. 2 choose the C++ language 3) Drag in the .cpp and .h files from the repo: 3 drag in source files

As you asked how you can do it here is how you can do it.
Run git commit and git push when you do the following things:
1. Change machines
2. Edit the project
3. Add, edit or delete files.
Run git pull when you do the following things:
1. When you start to work on a another machine.

Related