See the version control handout for details on how to do this.
To turn in your code:
To create a tag, follow Git » New Tag... in IntelliJ. By default, the tag is placed on the most recent commit that you've made. This means that, when you're placing a tag, you should make sure you've committed all your work so the TA will see your completed code. We will grade all work up-to and including the work done in the commit that's tagged.
At the bottom of each assignment, we specify a specific tag name that you need to use to mark your final code submission for that assignment. You must use the correct tag name, or your assignment has not been submitted. Tags are case-sensitive.
When you create a tag, DO NOT add a message. Adding a tag message changes what kind of tag is created, and can cause problems later on. You should name the tag appropriately, but leave the tag message blank.
When you create a tag, it's created in your local repository only, just like commits. In order to let GitLab know that you made a new tag, you need to push the tag, just like commits! Unfortunately, tags aren't included in a normal push, so follow Git » Push as usual, but make sure the "Push Tags" checkbox in the bottom left corner is checked.
The above works just like a normal git push, except it also includes tags in the push. Be sure that tags are pushed, otherwise TAs will not be able to find your assignment when we get to grading!
You are responsible for ensuring that your submission appears in the gitlab repository (with the appropriate tag) as you intended it. We will only grade what appears in gitlab, not what is on another machine.
Here are some additional checks that you can perform to ensure that this is the case. The first item will catch most problems. The second, while more time consuming, is more foolproof.
bash$ ssh-keygen -o -t rsa -b 4096 -C "your@email.com"
bash$ cat ~/.ssh/id_rsa.pub
bash$ git clone git@gitlab.cs.washington.edu:cse331-QUARTER-students/cse331-QUARTER-MyCSENetId.git bash$ cd cse331-QUARTER-MyCSENetId bash$ git checkout hwN-final
bash$ ./gradlew GradleTaskName
bash$ cd .. bash$ rm -rf cse331-QUARTER-YourCSENetID
Listed below are some special cases that don't necessarily apply to every submission. See below if it's relevant to your situation.
To use a late day, do not tag your repository on the day it is due. Instead wait to tag your repository once you complete the homework (before the late day deadline)!
If you've already created and/or pushed a tag, but you decide to take a late day or make change to your code and want to move the tag, do the following. Since removing tags is a little more complicated and is fairly rare, there isn't a menu for this in IntelliJ. We'll need to use the IntelliJ terminal window for a few steps (the same terminal you may use to run gradle tasks). (Windows users may need to run these commands from Git Bash instead of the terminal. Contact the course staff if need help with this.) The basic process is broken down into four steps:
Note: Some mac users may recieve an error message or a request to install xcode or the command line
developer tools when running the git
command from the IntelliJ terminal. Instead of typing
just git
, use /usr/local/bin/git
. If you're still having issues, contact
the course staff for help.
To remove the old tag, run the following command from the IntellIJ terminal. (The "-d" means "delete".)
bash$ git tag -d TAG-NAME-HERE
To remove the tag from GitLab, run the following. This will remove the tag with whatever name you specify from GitLab. This needs to be done separately because of how tags behave in git. If you tried to push the new tag without removing the old one from GitLab first, you'd get an error.
bash$ git push origin master :refs/tags/TAG-NAME-HERE
Create the new tag on your updated code. Depending on the situation, you may want to tag your most recent commit or you may want to go back and tag some earlier commit in your history. To tag the most recent commit, simply follow the Creating a Tag (Step 2) instructions above. To tag an older commit in your history, follow the instructions in the "Tagging an Old Commit" section to follow. Once you have a tag in the right place, push it to GitLab as described in the Pushing a Tag to GitLab (Step 3) section above. If you get an error about the tag already existing, make sure you have deleted the old tag from GitLab by running the above command.
Sometimes, you need to put a tag on a specific commit in your repository. For example, this happens if the tag wasn't in the right place when you originally submitted your code, but you've already been working on the next assignment and have newer commits in your repository. To do this, there are two main steps: (a) figure out which commit you want to put the tag on, and (b) put the tag on that specific commit.
https://gitlab.cs.washington.edu/cse331-QUARTER-students/cse331-QUARTER-NETID
.
Make sure to replace QUARTER
with the current quarter, and NETID
with your netid.
42fbcd22
.
bash$ git logYou can now browse your log using up and down directional keys on your keyboard.