Lecture 6 - Version Control (Git)
View lecture View lecture notes
Exercises
-
If you don’t have any past experience with Git, either try reading the first couple chapters of Pro Git or go through a tutorial like Learn Git Branching. As you’re working through it, relate Git commands to the data model.
Self explanatory.
Unrelated to the question but this Git cheatsheet from Atlassian might be quite handy for the rest of the questions and in general for life.
-
Clone the repository for the class website.
a. Explore the version history by visualizing it as a graph.
git log --graphgit logwill give a linear history of all the commits. Adding the--graphflag prints out a graph to go along with the commits.b. Who was the last person to modify
README.md? (Hint: usegit logwith an argument).git log README.mdgit log <filepath>lists only the commits in which the aforementioned file has been modified.c. What was the commit message associated with the last modification to the
collections:line of_config.yml? (Hint: usegit blameandgit show).git blame _config.yml git show a88b4eacgit blameshows what revision and author last modified each line of a file. Here thecollections:line of the_config.ymlfile contains the sha1hasha88b4eac. Hence, on running the subsequent command, that is,git show a88b4eacwill show the log message associated with that commit. The commit message reads as followsRedo lectures as a collection.