Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect Xcode 9 and GitHub?

I am part of a group of computer science students building their first project in Swift. We have attempted to connect GitHub with the XCode git configurations so we can all edit one project through pushing and pulling commits. We have little to no prior experience implementing GitHub with native applications such as XCode and online articles have not explained how we can create a project in XCode and connect it to GitHub so we can push and pull to Github and edit a 'master project' that we all have access to.

The closest we have gotten is doing XCode -> Preferences -> Accounts and adding new GitHub accounts(ours). However, the project does not show up when we open our GitHubs.

Does anyone know how we can make a collaborative project with GitHub and achieve the above goals? Please frame your answer in the context of us being totally unfamiliar with the process.

Thanks much!

like image 243
AeroFighter76 Avatar asked Dec 07 '22 15:12

AeroFighter76


1 Answers

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.

enter image description here

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:

enter image description here

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.

like image 76
Swift Dev Journal Avatar answered Dec 11 '22 08:12

Swift Dev Journal