Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a git repository in xcode 9.0?

Tags:

git

xcode

I'm trying to add a remote git repository in xcode project but I'm unable to find an option for that. getting option as

enter image description here

but expecting

enter image description here

Is there any other way to add remote repository to a project?

like image 790
New iOS Dev Avatar asked Aug 26 '17 07:08

New iOS Dev


People also ask

How do I add a Git repo to Xcode?

Go to Source Control in Xcode and select Projectname -- master, then Configure... In the Address field, paste the Git clone URL for your repo copied in the previous step. Select Add Remote, then select Done to finish creating the origin remote for your local Git repo.

How import GitHub repository 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!


3 Answers

Navigate to Source Control tab right next to the Project Navigator, then right click on your project and select the Add Existing Remote.

enter image description here

Then enter your remote URL.

enter image description here

like image 154
Hassan Shahbazi Avatar answered Oct 08 '22 00:10

Hassan Shahbazi


You can use this command in terminal:

git remote add origin https://Your_git_URL.git
like image 30
Mehdi Avatar answered Oct 07 '22 23:10

Mehdi


Learning to do git from the console is very easy too use this as a reference

like image 35
Erinson Avatar answered Oct 08 '22 00:10

Erinson