5

I am trying to clone a git repository from GitHub to use in the xcode ide environment, however it seems to be stuck on the 'Checking out' phase. I've left it for an hour but it seems to be hung on this stage.

I go to the Github repository, then copy the URL that is under the tab 'Code'. In xcode, I select 'Clone an existing project', enter the URL, put in my Github account details and password etc and then save to my computer in Documents. Then I click 'Clone' and it proceeds but gets hung on the Checking Out screen.

I've watched a few online videos and there was the option to open in xcode directly from GitHub itself. But, despite the video only being a year old, this option now seems obsolete and is no longer available, at least in what I can see.

Anyone know how to resolve?

CAF
  • 329
  • 3
  • 14

2 Answers2

3

I've had a similar issue with a particular project when using Xcode 12.4 on OS X 11.0.1 (Big Sur). To get around it I just checked out the code on the command line via git then opened it up in Xcode.

git clone https://github.com/<user>/<project>.git

Just use the "Open a project or file" option in Xcode and point it at the checked out code.

Robert Hunt
  • 7,914
  • 5
  • 40
  • 43
  • Thank you for your reply. I only managed to try your suggestion now. Unfortunately I get 'could not open file'. When you say 'point it at the checked out code' do you mean just go to xcode, choose 'open a project or file' and select the directory of the cloned repo? – CAF Mar 01 '21 at 12:52
  • @CAF Yes, I used the 3rd option "Open a project or file" and then selected the directory that I manually checked out with git on the command line. This will be the directory containing the .git folder. – Robert Hunt Mar 01 '21 at 22:29
  • thanks, yes this is what I have done although the directory does not contain a .git folder. Is it a problem? – CAF Mar 02 '21 at 07:49
  • @CAF the .git folder contains all of the repository information and is what makes the directory a "git project". It may be hidden by default as some operating systems hide folders that start with a "." - if it's not there then you may have the wrong directory. – Robert Hunt Mar 02 '21 at 11:08
  • I'm experiencing exactly the same issues you have had. Have you managed to fix it? @CAF – patoglu Mar 27 '21 at 10:46
  • @sushibossftw Hi, no unfortunately I did not - I suspect the reason could be that the github repository I was trying to clone into xCode does not contain a .git folder. Does your repository have such a folder? I would have assumed, however, that a .git folder appears automatically when one tries to add a repository to github. – CAF Mar 27 '21 at 11:47
  • Mine also doesn't have any .git file. I will try doing the same thing with a repo which contains .git file and notify you, thanks. @CAF – patoglu Mar 27 '21 at 13:04
0

I know I'm a bit late on this discussion but I found the solution for this in this link -> https://help.dropsource.com/docs/documentation/after-dropsource/accessing-your-source-code/importing-ios-source-code-into-xcode/#importing-into-xcode

after cloning the project using a terminal as described by Robert Hunt open your Xcode and select open a project or file. Then navigate inside the cloned project where you have the file with extension “.xcodeproj” and select it(usually inside Clonedproject->iOS).

Hope this helps someone in future!!

PerumalR
  • 1
  • 1