After merging, Github will also give you the option of deleting the `lab##` branch. Please, DO NOT DELETE the branch. We need it for grading purposes.
Lab Submission
To receive credit for your coding hour, you must follow the steps below:
-
If you are attending the lab session in person, sign in with the teacher assistant
and submit the date in the appropriate “Lab Attendance” assignment in Canvasto earn participation credit. -
Decide whether you are going to spend an hour on your homework or project, and open that assignment in Eclipse. (You may not switch later, so choose wisely!)
-
In Eclipse, create a branch named
lab##
where##
is the 2 digit week number. For example, name the branchlab02
if this is your first lab session during week 2. -
Create a “trivial” commit to mark the start of lab in this new branch. You can do this by adding a comment to the code like
// Start of lab
and then committing the change. -
Work on your code. Make sure you commit often as you need at least 3 non-trivial commits to earn lab credit. This works out to 1 commit every 20 minutes—set a timer if you think that will help. Once you are used to
git
, it is likely you will have more than 3 commits by the end of the hour. -
When you are done, make sure to push your changes to Github if you have not already.
-
Now, it is time to combine your
lab##
branch back into themaster
branch. Open a browser and navigate to your Github repository. Click on the “branches” link, and make sure you should see your lab branch and commits. -
Click the “New pull request” button next to your lab branch. The base branch should be
master
and yourlab##
branch should be in the “compare” dropdown. Enter “End of lab” as the message and click the “Create pull request” button when done. -
If all went well, you should now see a “Merge pull request” button. Click that button to finalize the merge of your lab changes into your
master
branch. -
Copy and paste the link to your pull request into Canvas to earn lab credit. From here, we’ll be able to see all of your lab-related commits.
-
You are not done yet! Go back to Eclipse, and switch back to the
master
branch. Make sure you pull your changes that you made on Github back into your local repository. You are successful if you see your lab changes show up in Eclipse.
These steps are not designed just to annoy you. It is forcing you to get used to several core git
and Github operations that you are likely to encounter in industry. So, even though it is 10+ steps to submit a lab, it can all be summarized as “use git
normally for an hour” once you are used to this ecosystem.
If you do not follow these steps, we may not be able to verify your lab submission! If something goes wrong, you can try submitting a different hour of work (remember, you should be spending at least 8 hours a week on this class outside of lecture).