Table of Contents
Git In-Depth
Introduction
After reviewing the course prerequirements, Nina Zakharenko introduces her Git In-Depth course. Git is distributed version control system.Course Agenda
Nina sets the course agenda and underscores the importance of using the command line to learn Git better.
Git Foundations
Data Storage
Nina 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 Trees
In 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 Commits
Nina 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 Exercise
After configuring their editor, students create a simple Git commit for this exercise. Nina takes questions from students.Simple Git Commit Solution
Nina walks through the Solution for the Simple Git Commit Exercise.
Git Areas and Stashing
Working Area, Staging Area, Repository
Nina 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.Stashing
Nina 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 Exercise
In this exercise, students examine interactive staging, unstaging files, and stashing uncommitted changes.
References, Commits, Branches
References
Nina reviews references in git: tags, branches, and HEAD.Tags & Annotated Tags
Nina 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 Commits
Nina 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 Exercise
In this exercise, students examine references and create some lightweight and annotated tags.References Solution
Nina walks through solution to References Exercise.
Merging and Rebasing
Merging and Fast Forward
Nina 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 Conflicts
Nina 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 Exercise
In 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 Solution
Nina walks through the solution to Merging and ReReRe Exercise.
History and Diffs
Useful Commit Messages
After discussing the pitfalls of bad or unuseful commit messages, Nina reviews policies and benefits of writing good commits.Git Log
Nina reviews git log, the basic command that shows you the history of a repository.Git Show and Diffs
Nine 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 Exercise
In 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 Solution
Nina walks through the solution to History and Diffs Exercise.
Fixing Mistakes
Git Checkout
Nina reviews git checkout command, which allows for resolving mistakes by restoring working treefiles or switching branches.Git Clean & Reset
After 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 Revert
Nina 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 Exercise
In this exercise, students practice reverting a file and cleaning a repository.Fixing Git Mistakes Solution
Nina walks through the solution to Fixing Git Mistakes Exercise.
Rebase and Amend
Git Amend
Nina reviews the git amend command, which is a quick and easy shortcut to make changes to the previous commit.Rebase
Nina 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 Autosquash
Reviewing the amend command, Nina reviews methods for associating changes to arbitrary commit using the fixup and autosquash flags for commit and rebase commands respectively.Abort
After discussing the abort command when rebasing attempts are not working, Nina reviews tips and advantages on implementing rebase.Git Rebase and Amend Exercise
In this exercise, students practice amending commits, attempt a normal rebase, and an interactive rebase.Git Rebase and Amend Solution
Nina walks through the solution to Git Rebase and Amend Exercise.
Forks & Remote Repos
GitHub vs. Git
After discussing talking about central vs. distributed version control, Nina discusses comparisons between git and GitHub.Remotes
Nina 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, & Upstreams
Nina 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 Workflow
Nina discusses triangular workflow when working with GitHub, tracking branches,Forks and Remote Repos Exercise
In this exercise, students create a fork and set up remotes.
Danger Zone
Local and Remote Destructive Operations
Nina reviews destructive operations that endanger changes lost forever.Recover Lost Work
Nina discusses techniques to recover lost work with git and GitHub.
GitHub
GitHub Shortcuts
Nina demonstrates shortcuts when working on GitHub.com.Continuous Integration
Nina talks about continuous integration, which involves merging smaller commits more frequently allowing new features to be released quicker.Continuous Integration Exercise
In this exercise, students set up an example of continuous integration.Continuous Integration Solution
Nina walks through the solution to Continuous Integration Exercise.
Advanced GitHub
GitHub API
Nina reviews GitHub's RESTful API for making requests, create and updating issues, pull requests, and more.GitHub API Exercise
In this exercise, students use the GitHub REST API.