Set Up

In this course, we will be using GitHub Classroom to manage projects and labs. To get setup with your own GitHub repository with our stencil code for the first project, refer to the Getting Started section of the Stars handout.

As you work on your project, feel free to use git for version control by regularly committing and pushing your work. You can do this by running:

git add -A
git commit -m "<descriptive message>"
git pull
git push

In order to submit you will have to create two or three new branches. You create the branches using a similar process. First create a base branch which we will make only contain the stencil. Then, we will create the branch to handin your assignment for grading so you can keep pushing to master as you work on future parts. Then, if there is a code review associated with the asignment, create the code review branch. To do this for base branch, first create a base branch by running git checkout -b base. Now you must find the commit id of the most recent commit made by an HTA on your repo. The commit id can be found by running git log or in the GitHub web application. The shortened commit id is shown below in the red box and clicking the clipboard will allow you to copy-paste the hash. The actual commits may differ from repo to repo, but just use the commit most recently made by an HTA. Commit IDs IMPORTANT: Ensure that you are now on the base branch. If you do the following on master, you could lose all of your changes. You can use git branch -a to view your current branch. Once you have found the commit id and are on the base branch, run git reset --hard <HTA commit id> then run git push --set-upstream origin base. If you top commit for your base branch is the last commit made by one of the HTAs, you are good to proceed! Note that now you are on the base branch, so if you want to get back to master run git checkout master.

Now create your handin-<project name> branch doing something similar to above without resetting it to the stencil state. First, ensure you are on your master branch by running git branch -a. You should then run git checkout -b handin-<project name> to create the branch. Then, run git push --set-upstream origin handin-<project name> to push the branch with everything that was in master to the repo.

If you need to do a code review for this project, do the same as the handin branch to create your review branch. Remember to start from your master branch.

Submit Your Project

In order to allow your grader TA to access your code submission and give feedback that will help you to improve upon your code for future projects, we will be using pull requests. Pull requests let you tell others about changes you've pushed to a GitHub repository. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary. For the purpose of this course, your grader TA will be giving you direct feedback on your code using this feature.

First, once you are ready to submit your project, push your most recent changes by following the steps above. The complete version of your project should be on GitHub now.

Branches let you keep track of an independent line of development for a project. You can read more about them here. For us, you will create a pull request from your handin-<project name> branch to the base branch, which will be where your submission code will live as we review it.

To make a pull request, go to your private projects repo on GitHub and click on the Pull Requests tab.

Click on the Pull Requests tab

Then, click on the "New pull request" button on the right.

Click on the 'New pull request button'

Set the base branch to base and the compare branch to handin-<project name>.

Compare handin-project to base

Click on the "Create pull request" button (twice). You've created your pull requests - you're almost there!

Do not click the "Merge Pull Request" button on GitHub after your submission (a TA will do that after grading your project). Though you will be able to see your grader TA’s comments directly on the pull request, please do not reply to those comments on GitHub. Instead, contact your grader TA via email if you have a grade complaint.

Now, create another pull request following the same steps from base base branch comparing the review branch. This will allow your peers to review your code as well.

Compare review to base

Your pull requests will reflect the changes you made from the stencil (since base contains only the stencil and your branches are being compared to base).

Hand In

Once you have created your pull request, you need to hand in your pull request URL to us, so that we know where your submission code lies. Please re-handin your code if you add more commits. We will use the last commit before you run this script as your final handin.To hand in your project pull request URL, fill out this form:

Handin Form

We will consider the most recent handin to this form as your final handin if you submit the form multiple times. If this handin is after the deadline, we will assume you are re-handing in your assignment late and we will use that handin.

For partner projects, only one partner has to fill out the form.

That’s it! Congrats on finishing your project!