About GitHub Classroom

Time to Git it done... here are few preliminaries about this tutorial:


Definitions


Git is a version control tool that serves an invaluable role in the software development cycle. It helps you save your work at regular, modular intervals, roll out and back changes, and a myriad of other uses.

GitHub is a remote repository for your local Git repositories, allowing your version control to be backed up the cloud, accessible from any computer with internet, and enables a variety of team collaborative tools.

GitHub Classroom is a subset of GitHub that specializes in deploying assignments as mini, personalized repositories that you will use to acquire your starting code skeletons, manage your work as you develop iteratively, and then finally to submit your products.


By now, you've likely used GitHub in other classes but may be unfamiliar with the procedure for GitHub Classroom, and especially, if you're using some popular Integrated Development Environment (IDE) to manage your version control.

As such, the tutorial below has snippets that will guide you through some of these murky waters.


Preliminaries


By now, I'm assuming you're familiar with the fundamentals of Git, and have a sufficient grasp on using its operations (e.g., add, commit, push, pull, ...). For a refresher, watch some of the videos here:

GitHub Tutorials


Make sure you have also set up your SSH Key or Personal Access Token for your GitHub account to be able to use Git's command line tools; when doing so ensure that you give your token full permissions and make sure it never expires following the tutorial here:

GitHub PAT Tutorial


For setup instructions for your IDE / Coding Environment, see the tutorial below:

Python Dev Environment Setup



Finding Assignments

Before beginning, ensure that you have a GitHub account and are enrolled in your section's GitHub Classroom (each assignment will have a roster with your name in which to accept -- if you do not find your name, contact me).

Independent of your development environment, your first task will be to find the assignment's URI on GitHub.

  1. Log into your GitHub account on https://github.com/

  2. Find the current assignment's Classroom Listing (it will be linked on the assignment page).

  3. Accept the assignment and, for Group Assignments, ensure that you are a part of the proper team.

  4. A personal version of the repository will be created for you after you Accept the assignment when prompted. Your personal repository will look something like cmsi281-fall2019-classwork1-YOUR_GITHUB_USER_NAME

  5. On your personal repository's page, find its URI (the location on GitHub where your remote repo lives). See screenshots below, which reveal a repository's URI by clicking on the greeb Clone or Download button and copying the address in the HTTPS section:

With this URI in hand, continue on to the section below that gets you set up in your particular environment!



Standard Git

This will determine where your local repository lives in your computer's file system.

  1. Open a terminal and then navigate to wherever you'd like your local repository to be stored. I recommend something like the following:

      C:\Users\yourusername\git\lmu-cmsi2120-fall2021
    

    Use the cd path command to change directories to the parent folder wherein you'd like the repository to live (where "path" is a placeholder for the file path like above; you might type something like cd C:\Users\yourusername\git\lmu-cmsi2120-fall2021).

  2. Find the GitHub repository that you'd like to clone on your own computer. This will typically be supplied by a Github Classroom link and be available on the green Code button on any GitHub repository page, like the following:


  3. Clone the repository through the command git clone <repo> where <repo> is a placeholder for the link you copied in the previous step.

  4. If all goes well, you should see some print out like the following:

    ...and yes my computer is named FORNTRON-OMEGA

Submitting Assignments


Once you're ready to commit changes to your repository, perform the following:

  1. Ensure that you're in your terminal directory of your local git repository (typically: the folder above the src folder in your repo--the one with the README.md file)

  2. (Optional) type git status to make sure you have changes ready to be made -- you'll see files that you've edited reported by this executable if so.

  3. (Optional) type git pull if working in a team setting to make sure you're working from the most updated version of others' changes.

  4. Type git add -A to add ALL changed files, otherwise, you can target specific files to be staged for the commit

  5. Type git commit -m "INSERT_MESSAGE_HERE" where you'll replace INSERT_MESSAGE_HERE with an informative note of what this commit accomplishes.

  6. Type git push to commit your changes to your remote GitHub repository -- it is this step that officially "submits" your assignment.



  PDF / Print