How to Connect Xcode 9 and Github

How to connect Xcode 9 and GitHub?

You can put the project on GitHub from Xcode 9's source control navigator. Start by opening the source control navigator by choosing View > Navigators > Show Source Control Navigator or pressing Cmd-2.

Sample Image

Select the Remotes folder, right-click, and choose Create Remote on GitHub. On Xcode 10 the menu item is Create "ProjectName" Remote. A sheet similar to the following will open:

Sample Image

Since you added your GitHub account to Xcode, you can choose the account from the Account menu. If you hadn't added your GitHub account, you would choose Add a GitHub Account and enter your account name and password.

Give your repository a name and add a description if you want. Choose Public for the visibility unless you have a GitHub plan (paid or student) that allows private repositories. Click the Create button and your project will be on GitHub for the other people in your group to clone. They can clone the project by choosing Source Control > Clone.

How to add local Git server account in Xcode 9?

You cannot add a "Git server account", and you don't need to. This has nothing to do with Accounts; you're looking in the wrong place.

If the question is how to clone from a remote repository, choose Source Control -> Clone and enter the required information. Or clone using the command line. Either way, once you have a clone, there is nothing else to do, as the clone contains the remote info.

Add Git to Existing Xcode 9 Project

1) First in order to make git ignore certain files you will need .gitignore file here is one for Swift or Objective-C add it to your repository folder.

2) then you need to remove all committed files use this command in terminal after changing directory to repository folder

git rm -r --cached . 

3) then add all files by using this command in terminal

git add .

4) and add the initial commit

git commit -am "initial commit"

if you didn't initialize git after removing .git folder skip step 2

Can't push or commit to GitHub in Xcode 9

Need to Add SSH following this link and use SSH as authenthication.

How to open an existing GitHub project with Xcode?

  • Download the project via git / or zip
  • Open folder
  • Double click on .xcodeproj file
  • if on the top left, you see a something like "Base sdk missing"
    • Double click on the first item in the three
    • Go to tag build
      • Select a sdk for the Base SDK
    • Close the opened popup
    • Click on build an run
    • If you have error, you should see a red icon on the right bottom

Add Xcode project to github repo?

The best way really is to follow the instructions GitHub gives you:

First, go the correct directory

cd <directory of your Xcode project>

It sound like you've already got a local Git project from Xcode. If that's true, skip this code block.

git init .
git add .
git commit -s
<type in a commit message>

Last, push into your repository. The following is copied directly from my own github account, after I created a new "test" repo. Change the "dhalperi/test" part.

Push an existing repository from the command line

git remote add origin git@github.com:dhalperi/test.git
git push -u origin master

How to add gitLab repository with Xcode 9?

Follow this steps https://www.raywenderlich.com/153084/use-git-source-control-xcode-9

https://developer.apple.com/videos/play/wwdc2017/405/

then on the left-side click source-control icon then add remote (see image)

NOTE: add url from gitlab

Sample Image



Related Topics



Leave a reply



Submit