Table of Contents
IntroductionAfter reviewing the course prerequirements, Nina Zakharenko introduces her Git In-Depth course. Git is distributed version control system.
Course AgendaNina sets the course agenda and underscores the importance of using the command line to learn Git better.
Data StorageNina reviews how Git stores information comparing it to a key-value store where data is the value and the hash of the data is the key. This system is also known as content-addressable storage, which is when the content to generate the key.
Git Blobs and TreesIn the .git directory, Nina reviews how git stores project information and its metadata into blob, tree, and commits objects, with each object storing different parts of the project like its content and folder structure. Deleting the .git directory, the information and history of the project are gone, but not the files of the project.
Git CommitsNina reviews commits, which is an object that stores the current contents of the project in a new commit with a log message from the user describing the changes. Nina takes questions from students.
Simple Git Commit ExerciseAfter configuring their editor, students create a simple Git commit for this exercise. Nina takes questions from students.
Simple Git Commit SolutionNina walks through the Solution for the Simple Git Commit Exercise.
Git Areas and Stashing
Working Area, Staging Area, RepositoryNina introduces the working area, staging area, and repository (repo). The working area is where files that are not handled by git. These files are also referred to as "untracked files." Staging area is files that are going to be a part of the next commit, which lets git know what changes in the file are going to occur for the next commit. The repository contains all of a project's commits.
StashingNina reviews stashing, which is saving work that is not committed to a git repo and is also safe from destructive operations. Nina takes questions from students.
Staging and Stashing ExerciseIn this exercise, students examine interactive staging, unstaging files, and stashing uncommitted changes.
References, Commits, Branches
ReferencesNina reviews references in git: tags, branches, and HEAD.
Tags & Annotated TagsNina discusses tags, which is another type of reference. Lightweight tags are simple points to a commit. An annotated tag points to commit and stores additional information such as author, message, and date.
Detached Head & Dangling CommitsNina explains that a detached head occurs when a commit is checked out instead of a branch. If a commit does not point or associates to a branch, the changes will not be references in git and eventually go to garbage collection.
References ExerciseIn this exercise, students examine references and create some lightweight and annotated tags.
References SolutionNina walks through solution to References Exercise.
Merging and Rebasing
Merging and Fast ForwardNina introduces merging as commits which happen to have more than one parent. Fast-forward occurs when there are no commits on the base branch that happened after the feature branch was created.
Merge ConflictsNina explains that merge conflicts happen when files have diverged too far. After explainigng that git stops the merging until the conflicts resulting from the attempted merge are resolved, Nina reviews "git rerere" command, which reuses recorded resolutions of future conflicted merges.
Merging and ReReRe ExerciseIn this exercise, students look at fast-forward merge, learn how to make a non-fast-forward merge, then learn how to use git's Reuse Recorded Resolution (ReReRe) functionality to automate complex merges.
Merging and ReReRe SolutionNina walks through the solution to Merging and ReReRe Exercise.
History and Diffs
Useful Commit MessagesAfter discussing the pitfalls of bad or unuseful commit messages, Nina reviews policies and benefits of writing good commits.
Git LogNina reviews git log, the basic command that shows you the history of a repository.
Git Show and DiffsNine discusses the show command, which allows for looking at comments and their comments, and the diff command, which shows changes between commits and more.
History and Diffs ExerciseIn this exercise, students practice making a good commit and examine command line arguments for git log, use git show to get more information about a commit.
History and Diffs SolutionNina walks through the solution to History and Diffs Exercise.
Git CheckoutNina reviews git checkout command, which allows for resolving mistakes by restoring working treefiles or switching branches.
Git Clean & ResetAfter discussing git clean command, which clears working area by deleting untracked files, Nina reviews git reset command, which removes the file from the index while keeping it in the working directory. Nina answers questions from students.
Git RevertNina discusses git revert command, which creates a new commit that introduces the opposite changes from the specified commit while the original commit stays in the repository.
Fixing Git Mistakes ExerciseIn this exercise, students practice reverting a file and cleaning a repository.
Fixing Git Mistakes SolutionNina walks through the solution to Fixing Git Mistakes Exercise.
Rebase and Amend
Git AmendNina reviews the git amend command, which is a quick and easy shortcut to make changes to the previous commit.
RebaseNina introduces the rebase command. Rebase pulls in the latest changes from master and applies your commits on top of those changes by changing the parent commit of your commits.
Fixup and AutosquashReviewing the amend command, Nina reviews methods for associating changes to arbitrary commit using the fixup and autosquash flags for commit and rebase commands respectively.
AbortAfter discussing the abort command when rebasing attempts are not working, Nina reviews tips and advantages on implementing rebase.
Git Rebase and Amend ExerciseIn this exercise, students practice amending commits, attempt a normal rebase, and an interactive rebase.
Git Rebase and Amend SolutionNina walks through the solution to Git Rebase and Amend Exercise.
Forks & Remote Repos
GitHub vs. GitAfter discussing talking about central vs. distributed version control, Nina discusses comparisons between git and GitHub.
RemotesNina reviews remotes, which is a git repository store elsewhere on the web, in GitHub, or somewhere else. Origin is the default name git gives to the server from which you cloned the project. Cloning a remote repo from a URL fetches the whole repo and makes a local copy into your .git folder.
Forks, Pull Requests, & UpstreamsNina discusses fork, which is a copy of the repo that is stored in your GitHub account. Upstream repo is the base repo created in a fork.
GitHub WorkflowNina discusses triangular workflow when working with GitHub, tracking branches,
Forks and Remote Repos ExerciseIn this exercise, students create a fork and set up remotes.
Local and Remote Destructive OperationsNina reviews destructive operations that endanger changes lost forever.
Recover Lost WorkNina discusses techniques to recover lost work with git and GitHub.
GitHub ShortcutsNina demonstrates shortcuts when working on GitHub.com.
Continuous IntegrationNina talks about continuous integration, which involves merging smaller commits more frequently allowing new features to be released quicker.
Continuous Integration ExerciseIn this exercise, students set up an example of continuous integration.
Continuous Integration SolutionNina walks through the solution to Continuous Integration Exercise.
GitHub APINina reviews GitHub's RESTful API for making requests, create and updating issues, pull requests, and more.
GitHub API ExerciseIn this exercise, students use the GitHub REST API.