How to connect Xcode 9 and GitHub?

ⅰ亾dé卋堺 提交于 2019-11-29 14:49:26

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.

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:

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.

Sh_Khan

Create a repository in GitHub (preferably private if you have a paid account) after you create the project head to terminal and navigate to project by:

cd  path_to_project

then run these commands

git init

git commit -m "first commit"

git remote add origin https://github.com/UserName/RepoName.git

git push -u origin master

After that you can commit and push from source control menu in Xcode, then every student make a checkout so he can add his tasks and push.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!