Video description
Master basic to advanced Git features such as commits, branches, merging, rebasing, and squashing
About This Video
- Understand how Git and GitHub work under the hood
- Get to grips with performing basic and advanced Git operations
- Learn how to manage repositories with GitHub, SourceTree, and Visual Studio Code
In Detail
Complete with practical activities, this comprehensive Git and GitHub guide will help you understand how Git works. You'll learn how to use Git features efficiently and fix issues in your development workflow.
Starting with the internal structure of a Git repository, this course will take you through the four types of Git objects: blobs, trees, commits, and annotated tags. You'll understand how each object has a unique SHA-1 hash and how all objects are stored in folders, files are stored in blobs, and filenames are stored in other Git objects called trees. You'll even get to grips with creating new Git objects without using git commit and git add. Once you've created Git objects in the Git repository, you will add it to the staging area and working directory.
By the end of this course, you'll have become a Git and GitHub expert and be able to perform basic and advanced Git tasks seamlessly.
Audience
Whether you're a complete beginner or a developer with years of experience using Git, this course will add to your Git and GitHub knowledge and help enhance your skills.
Table of Contents
Chapter 1 : Introduction to Git and GitHub
Introduction
Section 1 Introduction
Git Versus GitHub
Chapter 2 : Installation of Git and Configuration of the Shell
Section 2 Introduction
Installing Git on MacOS
Installing Git on Windows
Installing Git on Linux
Installing iTerm2 on MacOS
Installing Custom Z-Shell on MacOS
Chapter 3 : Basic Shell Commands
Section 3 Introduction
Shell Commands - Directory Management
Shell Commands - File Management - Part 1
Shell Commands - File Management - Part 2
Chapter 4 : How Git Works Under the Hood
Section 4 Introduction
Initializing a New Git Repository
Overview of the .git Folder
Git Object Types
Writing a New Git Object with a git hash-object
JSON Versus Git Database
What is the Hash Function?
Hash Function Overview
SHA-1 Hash Function
How Many Files can Git Store?
Probability Theory in a Dice Game
Git Hash Collision Probability
More details on hash collision probability (OPTIONAL)
Exploring Git Objects with the git cat-file Command
Creating a New Git Blob Based on a File
Why Git Blobs do not Store File Names
Contents of Git Objects
What Have We Learned so Far?
Tree Objects in Git
Git Object Permissions
Creating a Git Tree Object
(Free Preview): Examining Tree Object
Working Directory, Staging Area, and Git Repository
Overview of Current File Distribution
Git Read-tree
Reading Files in the Staging Area Using git ls-files
Git Checkout-index
Number of Folders Created for Objects
Section Summary
Chapter 5 : Basic Git Operations
Section 5 Introduction
What is Commit?
Configuring the Git Author Name and Email
Creating Your First Commit
Exploring a Commit Object
Project’s Current State Overview
Basic Git Commands
Adding a New File to the Working Directory
Git Files Lifecycle
Stage File
Unstage File using git rm
Committing Changes
Exploring Changes in a Git Repository
Current Diagram of a Git Repository
Chapter 6 : Git Branches and HEAD
Section 6 Introduction
Most Common Git Operations
Project’s Current State Overview
Installing GitHub Desktop
GitHub Desktop Overview
What is Branch in Git?
What is HEAD in Git?
Third Commit
Git Repository Changes after a Third Commit
Checking Out a Specific Commit
Why Do We Need Branches?
Git Branches Management
Creating a New Branch
Committing Changes in the New Branch
Exploring Commit in the New Branch
Why Git Reuses Blobs with the Same Contents?
Chapter 7 : Cloning, Exploring, and Modifying Public Repositories
Section 7 Introduction
Cloning Remote Repository
Exploring the Contents of the Cloned Repository
Unpacking Git Objects
Exploring Cloned Repository in GitHub Desktop
Installing the Text Editor Visual Studio Code
Exploring Visual Studio Code
Committing Changes in the Cloned Repository
Git diff Command
Overview of the Changes
Chapter 8 : Merging Branches
Section 8 Introduction
Why Branch Merging is Needed
Fast-Forward Merge
Merging process
Fast-Forward Merge in Action
Three-Way Merge
Performing a Three-Way Merge
Observing a Git Repository after a Three-Way Merge
Installing SourceTree
SourceTree in Action
What is Merge Conflict?
Creating Merge Conflict
Observing Conflicts in the Staging Area and Working Directory
Resolving a Merge Conflict in Terminal
Resolving Conflicts in Visual Studio Code
Chapter 9 : GitHub and Remote Repositories
Section 9 Introduction
What is a Git Hosting Service?
Creating a GitHub Account
Exploring the First Repository in GitHub
Creating Another Commit in GitHub
Creating a New Branch in GitHub
Making Changes in the New Branch
Cloning a Remote Repository
What is Remote Repository?
How Remote Repository Empowers Collaboration?
Chapter 10 : Git Push, Fetch, and Pull
Section 10 Introduction
Overview of the Push, Fetch, and Pull Git Commands
What is Origin?
Listing Remote and Local Branches
What is Tracking Branch?
Checking Out a Remote Branch
Git Remote Show Origin
Git Fetch in Action
Git Pull Two-Step Process
How to Perform Git Pull
What is FETCH_HEAD?
Git Pull with Fast-Forward Merge
Fetching Remote Changes Manually
Merging FETCH_HEAD Manually
Resolving Conflicts Using Git Pull
Pushing to a Remote Repository
Committing Under Another Author
How do Remote and Local Branches Sync?
Creating a Remote Branch Based on a Local Branch
Updating the Tracking Status of the Branches
Removing a Remote Branch Using a Local Terminal
Git Show-ref
Chapter 11 : Pull Requests
Section 11 Introduction
Collaboration Between Contributors
What is a Pull Request?
Why was Pull Request Named Pull Request?
Pull Request Versus Merge Request
Pull Request Step-By-step
Creating a New Repository in GitHub
Changing the Author of the Last Commit
Pushing Branch to Remote
Opening a Pull Request
Adding Comments and Approving a Pull Request
Creating and Publishing a New Branch Using GitHub Desktop
Signing into GitHub Using GitHub Desktop
Creating and Merging a Pull Request
Adding a New Collaborator in GitHub
Exploring Your GitHub Account
Opening and Merging a Pull Request Using a Collaborator
Merging without Approvals
Configuring a Protected Branch Rule
Merging after Gaining Required Approval
Exploring Pull Requests in the Public Repositories
Working with Issues in GitHub
Chapter 12 : Forks and Contribution to the Public Repositories
Section 12 Introduction
Creating a Fork
Synching Changes from the Parent Repository
Adding a New Upstream Remote Repository
Fetching Changes from Upstream
Synchronizing Changes from Upstream
How to Open Pull Request from a Forked Repository
Creating a Pull Request from a Forked Repository
Removing a Repository Collaborator
Forking Repository
Committing Changes in a Forked Repository
Opening Pull Request from a Forked Repository
Approving and Merging a Pull Request from a Forked Repository
Chapter 13 : Git Tags
Section 13 Introduction
Git Tags Overview
Staging Versus Production
Semantic Versioning
Lightweight Versus Annotated Tags
Creating Lightweight Tags
Creating Annotated Tags
Exploring a Git Tag Object
Pushing Tags to Remote
Chapter 14 : Rebasing
Section 14 Introduction
Introduction to Rebasing
Merging Versus Rebasing
How to Perform Rebasing
Rebasing - Step 1
Rebasing - Step 2
Creating a New Repository
Creating a Feature Branch and Making Changes
Rebasing a Feature Branch on Top of Master Branch
Completing Rebasing by Performing Merging
Exploring Graphs and Commits in SourceTree
Deleting a Feature Branch and Pushing to Remote
Chapter 15 : Ignoring Files in Git
Section 15 Introduction
Introduction to Git Ignore
Git File Statuses: Untracked, Tracked, and Ignored
Basic Git ignore Rules
Pushing Repository with Ignored Files to Remote
Committing Previously Ignored Files
Ignoring Previously Committed Files
Git ignore Common Practices and Templates
Chapter 16 : Detached HEAD
Section 16 Introduction
Detached HEAD State
Making Experimental Commits in Detached HEAD State
Retaining Changes Made in the Detached HEAD State
Chapter 17 : Advanced Git
Section 17 Introduction
Cloning One of the Public Repositories
Git Log Options: Oneline, Graph, and Stat
Git Shortlog
Filtering Commits by Author or Keyword
Pretty Formatting of Git Log
Filtering Merge Commits in Git Log
Git Reset
Git Revert
Modifying the Last Commit Using the Amend Option
Cherry-picking Commits
Reflog - Log of All Git Operations
Stashing Changes Using Terminal
Stashing Using GitHub Desktop
Garbage Collection
Squashing of Commits in GitHub
Interactive Rebasing with Squashing in the Local Repository
Git Development Workflow
Chapter 18 : GitHub Pages
Section 18 Introduction
Creating a Simple Website Using GitHub Pages
Hosting any Repository Using GitHub Pages
Creating a Basic React application
Preparing the React Application for Publishing to the GitHub Pages
Fixing Errors with Cached Credentials Using SSH Instead of HTTPS
Verifying a React GitHub Page
Configuring a Custom Domain for GitHub Pages
Creating a Static GitHub Page Using Markdown
Chapter 19 : GitHub Hooks
Section 19 Introduction
Normal Git Workflow without Hooks
What are Git Hooks?
How Git Hooks can Be Used in Practice
Using a Pre-Commit Hook
Enabling a Post-Commit Hook
Disabling Rebasing Using a Pre-Rebase Hook
Matching an Author’s Email against a Regular Expression
Why Local Git Hooks are not Pushed to the Remote
Cleaning Up the Local Git Hooks Repository
Initializing a New Node.js Project
Installing the Jest NPM Package for Testing
Adding Multi and Sum Modules with Tests
Using the Pre-Commit NPM Package for Automation of the Pre-commit Hook
Cloning a Remote Repository and Verifying a Pre-Commit Hook
Replacing a Pre-Commit NPM Package with Husky
Skipping All Git Hooks Using the –no-verify Option
Introduction to Linter and Running Linter in the Pre-Commit Hook
Introducing a Lint-Staged Package to Check only Staged Files
Verifying Selective Linting and Testing Using Lint-staged
Adding a Post-Commit Hook
Verifying Commit Message Using Commitlint
Git Hooks Summary
Chapter 20 : Wrap Up
Wrap Up