Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
256 views
in Technique[技术] by (71.8m points)

ios - 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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...