git will be used throughout this semester as the version control system for MPs and labs. Specifically, we will be using git for two functions:
While we do not require that you learn and use good version control practices, we cannot stress enough how useful a good version control system can be when good practices are used. The following is a brief list of good version control practices:
Again, the above practices are not hard and fast, nor complete, but they should help you complete your MPs and future coding projects should you use
git for them as well.
There are two repositories that you’ll be interacting with as part of this course:
In general, code will be released to
release and you will merge it into your repository to get the initial code. You’ll then complete the MP or lab and then commit your code to your repository. We will view the latest submission you made before the due date to grade your work.
To get everything set up, there are certain things you will need to setup once the entire time you’re in the course, things you need to setup once per computer you use, and things you need to do once per MP.
The first time you’re accessing the CS 225 repository this semester, you will need to have a CS 225 repository set up for you. This process is simple:
To setup your computer to work on an MP or a lab, you will need to clone your repository onto your comptuer.
The URL of your repository will be based on your NetID and you will need to replace NETID with your NetID.
To clone your repository, run
git clone https://github-dev.cs.illinois.edu/cs225-sp19/NETID.git cs225git
…you can replace cs225git with whatever folder you want created. For example, you may want to call your folder just “cs225” or “cs225sp19” or anything else.
Password entry On some systems, git (and other command line programs) will not display anything when you type your password. This is expected: type your password as normal, and then hit enter.
Finally, move into the directory you just cloned:
releaserepository as a remote
To connect to the release repository, you need to add a remote:
git remote add release https://github-dev.cs.illinois.edu/cs225-sp19/_release.git
You’re now all set to begin to work on an assignment! :)
To retrieve the latest assignments for CS 225, you need to
release repository into your repository. This can be done with two commands:
git fetch release git merge release/LAB_NAME -m "Merging release repository"
LAB_NAME literally here; on each lab we will provide the proper name to use.
git happens to complain about unrelated histories, use this command:
git merge release/LAB_NAME --allow-unrelated-histories
Every time you want to submit work, you will need to
push your work to your git repository. This can always be done using the following commands on a command line while within your CS 225 directory:
git add -u git commit -m "REPLACE THIS WITH YOUR COMMIT MESSAGE" git push origin master
You should substitute
"REPLACE THIS WITH YOUR COMMIT MESSAGE" with a short message describing what you did since the commit. This will help both you and course staff understand what you did in a specific commit.
Some examples of “good” commit messages:
Some examples of bad commit messages:
You can always verify your submission by visiting https://github-dev.cs.illinois.edu/ and viewing the files in your repository. Only the files that appear on the
master branch of your github-dev repository will be graded.