Import project from git in xcode
For Xcode 9.4 and Git repository without *.xproj
file simple Source Control -> Clone... method doesn't work. Xcode just clones remote repository and opens it in Finder - no project is created nor opened.
Here is what worked for my remote C++ repository:
$ git clone [your_repo.git]
- Create new project Shift + CMD + N
Enable version control
Now you should have cloned repo and new Xcode repo:
In your new Xcode repo remove all except *.xcodeproj
In Xcode remove default Groups and Files (except Products):
Copy cloned repo content into new Xcode project directory:
$ ditto [cloned_repo/] [new_repo/]
.Check that
.git
directory was copied successfully.Add dirs and files into the project. Drag'n'drop them from Finder to your new Xcode project. Don't drag
.git
and*.xcodeproj
.Check branches and commit history:
For xCode 6 and lower
In xCode go to Window >> Organiser
Then select repositories
Click the + button and select Checkout or Clone repository
Then enter the details for your GIT
For xCode7 and above
Go to Window >> Welcome to xCode
Click on the Check out an existing project button on the left hand side.
Then enter the details for the repository you want to access.