GitHub and GitHub Classroom

We will be using the GitHub Classroom to assign, manage and grade the programming projects in the DSA I course. You must setup a github account before you can use the GitHub classroom service.

GitHub.com

GitHub.com is the most popular hosting service for software repositories managed with git. It provided many useful services to programmers. It is also a social networks for programmers. Programmers collaborate on open source projects on GitHub.com.

You can clone public repositories from GitHub. However, you will need to authenticate yourself when cloning private repositories or pushing changes to any repositories. There are two protocols available from GitHub.com to synchronize with the server: 1. HTTPS, 2. SSH. The authentication methods varies depending on the protocol you use.

TL;DR: Beginner can choose HTTPS protocol for simplicity while advanced user who use SSH key pair for other purposes may go for the SSH protocol. (updated in 2022)

HTTPS Protocol

When you work with a URL starting with https://github.com/, you are using the HTTPS protocol to connect to the server. To authenticate yourself, a user name and a personal access token will be asked in the first time when you try to connect to the server using your GitHub account. In most of the operating system, your credential will be stored and you no longer need to input the next time.

The personal access token is not your password. You must generate it for your GitHub.com account. Read this instruction to learn how to generate the token.

The token will be shown only once right after generation. Keep it in a safe and convenient place for future use.

Git can also store your credential locally so you do not need to input every time. The command to enable this feature is git config --global credential.helper store

SSH Protocol

When you work with a URL starting with git@github.com:, you are using the SSH protocol to connect to the server. To authenticate yourself, you must set up a key pair first. You only need to set it up once to allow future access. Read this instruction on how to set up ssh key pairs.

GitHub Classroom

The GitHub Classroom is a service from GitHub.com. It is free of charges for educational usage. It is a great way to assign, collect and grade programming assignments.

Before you start to work on the assignment, you have to sign up an account at GitHub.com. You will be asked to bind your account with your name listed in the roster in the GitHub classroom. Never skip the roster when you are asked to bind the account. Unlinked accounts will bring in many problems in the grading process.

To use GitHub Classroom for assignment, follow the following steps:

  1. Accept the assignment

    A project repository will be created for you and you can refresh the page after several seconds to get the URL to your repository.

  2. Follow the general project workflow in the programming project document. Follow the steps listed below to clone the initial code:

    1. Copy the repository URI from your project repository web page (the green code button). Either using SSH protocol URI start with git@git.github.com or HTTPS protocol URI start with https://github.com/.

    2. Run git clone <URI> in the parent directory you plan to put the project directory in.

    3. A new directory will be created and you can start developing based on the starting files in the directory.

Note

After each push to the repository, auto-grading actions will be triggered. Wait a couple of minutes until the grades is updated. Check the result in the Action tab in the GitHub repository page by clicking the latest commit. Expend the auto-grading section to see details.

You may refer to the details on the linear git workflow employed in the general project workflow in the the git document.

Warning

The grades will be collected by GitHub Classroom at the due time. As I allow late submission up to two days, to obtain the correct grade for any late submission. You must notify me about that so I can grade it manually. It is a courtesy to students to accept late submission. Do not abuse that.