The ShoppingList++ Github repository is an online code repository that shows every step you, as the developer, would take, to make the final ShoppingList++ app. It employs branches not for merging, but instead to mark different state of the code.
There are four types of branches.
The branches are named with the lesson number and the checkpoint number. 4.02 would therefore be the second checkpoint in Lesson 4.
Below is a very brief explanation of the git commands you can use to navigate the repository and do quizzes. If you are completely unfamiliar with version control or want a more in-depth introduction, consider taking Udacity's Git and Github course.
This assumes you've already downloaded the codebase and you're following along with the repository the "fast way" (i.e., you're just doing each quiz and not building the entire app). The instructions for downloading the code are here if you do not have it yet.
(Optional) Commit your changes from the previous quiz. When you make changes to solve a quiz and then move on to the next quiz, these changes will be overwritten. If you'd like to save what you've done in a commit, you can type the following in a terminal:
git add . git commit -m "My changes for <lesson and quiz number>"
If you would prefer to just delete the changes you've made, you can type the following (NOTE This CANNOT be undone)
git reset --hard HEAD
Checkout the correct quiz branch checkpoint. When you're ready to work on a new quiz, find out what the quiz checkpoint is. In the instructor notes or the code spec, it's listed next to the word Code Step.
Once you have the code step, you can copy this text and in a terminal type the following to check out the code step. It should say quiz at the end. (Note that git tab completes, so you can also just start typing the number and press tab to complete):
git checkout 2.03_edit_shopping_list_name-quiz
Do the quiz. Now if you open your ShoppingList++ app in Android Studio, the code will be a at a state before the quiz has been solved, with TODOs to guide you through what to do. Finish the code step. Make sure to check that your solution works according to what's in the spec.
Compare your solution with the course's solution If you look at the Instructor Notes or the Spec solution, you should see a link to the Code Diff.
If you're doing things the thorough way (building the entire app alongside me), you can simply use the github pages as guidelines for where you should edit your code for each quiz. You can then compare your solution with our solution using the diffs.
Look at the top of the picture, you can see the two branches that are being compared. The left-side shows
1.01_connect_firebase_to_your_app-quiz and the right side shows
Look at the lines highlighted in red and green. A red highlighted line was one that was deleted from the first branch in the second branch. A green highlighted line was one that was added to the first branch in the second branch.
You can see here that the TODO comments were replaced by other comments, describing the solution code.