Working with GitHub

The Workflow We’re Using

In this course, you’ll use a focused Git workflow:

  1. Accept an assignment via GitHub Classroom
  2. Clone the repo to your Mac
  3. Add your existing project files (if necessary)
  4. Commit your changes as you work
  5. Push to GitHub

This page will walk you through this workflow, along with a couple troubleshooting steps you might find useful.

1. Accepting an Assignment via GitHub Classroom

After Getting Started with GitHub, when your instructor shares an assignment invite link, open it in your browser and click Accept this assignment. GitHub Classroom will create a personal copy of the starter repo under your GitHub account — this takes a few seconds.

After accepting, you can find your new repo by going to github.com → your profile icon → Your organizations → Your GitHub Classroom name (example: 2026-spring-nmix-4030-weatherford-1135). You’ll also receive a notification in GitHub linking directly to it.

2. Cloning the Repo to Your Mac

Cloning a repository creates a linked local copy of the assignment on your Mac. Any commits you make locally can then be pushed back up to GitHub.

  1. In GitHub Desktop, go to File > Clone Repository
  2. In the modal dialog, select GitHub.com and select the assignment repository. (Click the Refresh icon.
  3. Select your class OneDrive folder in the Local Path picker toward the bottom of the modal.
  4. In the Clone As… field, be sure to use the provided name for the destination folder, for example, project-one-uga12345
  5. Click Clone.
GitHub Desktop's Clone a Repository modal showing a GitHub Classroom assignment being cloned from GitHub.com to a user's local OneDrive folder.

3. Adding Existing Project Files (if necessary)

After cloning, you may need to add local files to your repository. To do so:

  1. In GitHub Desktop, go to Repository → Show in Finder to open the folder
  2. Copy or move the contents of your Xcode project folder into the repo folder

GitHub Desktop will immediately detect the new files and show them in the Changes tab. Green + icons indicate new files; yellow dots indicate modified files; red icons indicate deleted files.

4. Making a Commit

A commit is a snapshot of your project saved to your local repo. It does not go to GitHub yet — commits are local until you push them.

GitHub Desktop Changes tab showing 3 changed files with checkboxes and file status icons

In the Changes tab, make sure all files you want to include are checked. Then write a clear commit message in the Summary field. A good commit message is brief but descriptive — it answers what changed and why:

  • Add initial Xcode project files
  • Fix layout constraints in Main.storyboard
  • stuff
  • final final FINAL
GitHub Desktop Changes tab showing the Summary commit message field and Commit to main button

Click Commit to main. The changes are now saved locally. You can make as many commits as you like before pushing — think of them as checkpoints.

5. Pushing to Origin

Pushing sends your local commits up to GitHub. After committing, a Push origin button appears in the toolbar with a count of commits ready to upload.

GitHub Desktop toolbar showing Push origin button with commit count indicator

Click Push origin. Your commits are now on GitHub and visible to your instructor.

Troubleshooting

Rolling Back to a Previous Commit

If you introduce a bug or want to undo recent work, you can revert a commit. Switch to the History tab to see your full commit log.

GitHub Desktop History tab showing a list of past commits with author and timestamp

Right-click the commit you want to undo and choose Revert Changes in Commit. This creates a new commit that reverses the selected one — your history stays intact, which is important if you’ve already pushed.

GitHub Desktop History tab with right-click context menu showing Revert Changes in Commit option highlighted

Deleting a Local Repo and Re-cloning

If your local repo gets into a bad state, or you need to move to a different computer, you can always delete the local copy and re-clone from GitHub — all commits you pushed to GitHub are safe.

  1. In GitHub Desktop, right-click the repo name in the left sidebar and choose Remove — this removes it from GitHub Desktop only, it does not delete your files yet
  2. In Finder, locate the repo folder and move it to the Trash
  3. Repeat 2. Cloning the Repo to Your Mac to create a new local copy.

Your repo on GitHub is untouched. Re-cloning gives you a clean local copy with the full commit history.