Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import project from git in xcode

Tags:

git

xcode

I have a project under source control with at remote repository where I commit and push to.

Now I need to have another programmer work on the same project and therefore same Git repo.

I cannot figure out how one imports a project from an existing Git repo.

I have worked with Eclipse and Git where I have no problem doing this.

Any help is appreciated.

like image 847
Anton Avatar asked Aug 06 '13 15:08

Anton


People also ask

How do I copy a project from GitHub to Xcode?

Once you authenticate into Xcode with your GitHub account, the “Open in Xcode” button will appear for relevant repositories on GitHub. Click the button and Xcode will launch, prompting you to choose a directory to clone the repository to your local machine. Happy cloning!

How do I open a project from GitHub in Xcode?

Open your XCode application. Go to the Source Control Tab of XCode and go to Clone. Enter the repository URL you copied in the above step in the search bar at the top of the dialog and hit the Clone button. It will now ask you to sign in to your github account where the given repository is made.


3 Answers

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.

like image 132
Adam Richardson Avatar answered Oct 02 '22 23:10

Adam Richardson


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:

  1. $ git clone [your_repo.git]
  2. Create new project Shift + CMD + N
  3. Enable version control

    version control

  4. Now you should have cloned repo and new Xcode repo:

    new repo

  5. In your new Xcode repo remove all except *.xcodeproj

  6. In Xcode remove default Groups and Files (except Products):

    remove default groups and files

  7. Copy cloned repo content into new Xcode project directory:

    $ ditto [cloned_repo/] [new_repo/].

    Check that .git directory was copied successfully.

  8. Add dirs and files into the project. Drag'n'drop them from Finder to your new Xcode project. Don't drag .git and *.xcodeproj.

    drag'n'drop

    references

  9. Check branches and commit history:

    check version control history

like image 35
Petr Javorik Avatar answered Oct 02 '22 23:10

Petr Javorik


Since the answers are old, now there's an easier way to directly import/clone project into Xcode from Github and Bitbucket.

Bitbucket: Press Clone in Xcode button enter image description here

Github: Press Open in Xcode button enter image description here

like image 37
UsamaAmjad Avatar answered Oct 02 '22 21:10

UsamaAmjad