To teach myself Java, I took
UC Berkeley's CS61B: Data Structures course, which is completely free and public! Gitlet is the second of 3 major projects in this course, and served as my introdution to applying data structures in a fully functional project, all from scratch. You can find my code
here.
Gitlet can be tricky to grasp if you don't understand Git - this article by
Mary Rose Cook excellently breaks down how Gitlet works: