Adding an Xcode Project to the Repository
Now let’s add Playground to our repository. In Xcode, select File -> New -> Playground.
Select iOS and Blank for the Playground and click the Next button.
On the next screen, you get to select where the Playground will be saved. You want to save the Playground in the week-1 folder located in your repository. You must get this location correct; otherwise, your Playground may not be added to your repository.
Select the folder for this week’s homework and click Create. Depending on where your homework folder is located, you may get a dialog asking to allow Xcode to write to the folder. Click Allow.
Back in GitHub Desktop, you should have noticed that two changes are listed. These are the results of saving the Playground to the repository.
Let’s commit the changes. Provide a summary such as “added Playground to repo” and click the blue button with Commit 2 files to week 1.
After the commit is complete, click the blue Push origin to put our changes on GitHub. We can verify the changes have been pushed by looking at our repo on GitHub.
Clicking the drop-down labeled Main, we can see our branch. Selecting that branch will take you to the branch, and you will see the homework folder and the playground.
You are now at the point where you can complete the assignment for the week.
These steps are equivalent to staging the playground addition, committing those changes, and pushing the changes to origin.
# adding multiple files
git add .
git commit -m "added playground to repository"
git push
Let’s review what we have done so far.
- Created a Playground and saved it to our homework folder for the week
- Committed the changes
- Pushed our local branch and all of the changes to GitHub
Let’s add a mentor to the repository as a collaborator.