Lesson 13.0
Git is like save games for code: it keeps every version, and you can go back to any of them.
git init # create a repository
git add main.py # stage the files to save
git commit -m "First commit" # save a version
git log # look at the history
git add puts a file into the "basket", git commit saves everything in it;-m is the commit message: write what it means, "asdf" won't help you in a week;The check gives the list of commits commits — triples of "message, file, whether the
file made it into the commit". Print:
Total versions: <how many commits>;Latest: <message of the newest commit> — it is at the end of the list;Files: and one item - <file> for every file that made it into a commit, in
order of first appearance.The number of commits is len(list), the latest is by the index [-1].
Collect the files into a list without repeats and print it line by line. A commit with no file (an empty name) must not give an empty item.