Git And Github Complete Guide
Tags: Git
Complete Git and GitHub guide (23 HOURS) - Master all Git features: commits, branches, merging, rebasing and squashing
Last updated 2022-01-10 | 4.7
- Deeply understand how Git works under the hood- Use Git not just in terminal but also in graphical user interfaces like GitHub Desktop
- SourceTree
- Visual Studio Code
- Learn different GIt objects - blobs
- trees
- commits and annotated tags
What you'll learn
* Requirements
* We will start from the very beginning* from basic Git features and move on to advanced techniques and operations
* Prepare only your Mac
* Windows or Linux/Unix computer. Anything will work.
* If you are new to Git
* please start from the very beginning: learn how Git works and how to perform basic operations (git add
* git commit
* git branch)
* If you are advanced Git user I highly recommend you to watch "How Git works under the hood" section and then jump to advanced Git features like squashing
* cherry-picking etc.
Description
This course is all about Git and GitHub.
Understand HOW Git works and learn all Git features from basic commits to squashing and rebasing.
Blobs, Trees, Annotated tags, SHA1 hashes
If those terms are new to you - jump in and you will learn all about Git internals and afterwards practice basic and advanced Git features using multiple practice activities.
Become a master of Git, GitHub, GitHub Desktop, SourceTree and Visual Studio Code.
This is the most complete practical Git and GitHub guide here on Udemy that includes tons of practical activities. Most important is that you will learn how Git works and knowing it you will be able much more easier use Git features and fix mistakes in your development workflow. You can have zero knowledge about Git and GitHub. All will be taught from scratch, from basic to advanced features. If you want to get deep knowledge of Git and GitHub this course is for you!
We will start by exploring internal structure of the Git repository. You will learn that Git has 4 types of objects: blobs, trees, commits and annotated tags. Each object has unique SHA1 hash. Also all objects are stored in the folders. Every object has just single reference to it - SHA1 hash. Files are stored in blobs. Filenames are stored in other Git objects called trees.
I will explain you how to create new Git objects without using git commit and git add. After creating Git object in the Git repository you will checkout it to staging area and working directory (opposite direction to traditional Git flow)
Afterwards we will jump into tons of practice activities and use different Git and GitHub features
In practice sections you will perform multiple practice Git activities:
Initialize new Git repository
Make changes, add them to staging area and commit
Create branches, checkout branches and merge branches
Perform fast-forward and 3-way merges of the branches
Resolve merge conflicts
Move into detached HEAD state and make experimental commits there
Perform rebasing of the branches
You will also learn and practice different GitHub features
Connect local and remote repositories
Pushing, fetching and pulling operations
Open Pull Request
Merge Pull Request
Add software versions using Git Tags
Create forks from other repositories
Contribute to public repositories using technique of forks and pull requests
Perform rebasing with squashing
You will use not just terminal and shell commands for performing Git operations. In parallel you will also use GUI applications that simplify routine day-by-day Git operations:
GitHub Desktop
SourceTree
VisualStudio Code
With this course you will get lifetime-long access to almost 200 lectures and tens of practical exercises. After the course you will become a guru of Git and GitHub and will be able easily perform basic and advanced Git tasks.
But most important is that you will UNDERSTAND Git.
You will also get 30-days money-back guarantee. No questions asked!
Don't wait and join the course now!
Who this course is for:
- You could be either complete beginner or experienced developer with years of usage of Git
- You may know how to USE Git but you may not know HOW Git works
- If you want to learn HOW and WHY Git and GitHub work - this course is for you!
Course content
21 sections • 292 lectures
Welcome and Course Overview Preview 05:24
Welcome to the Git course! In this introduction lecture I will give you a quick overview of the course and tell you what will be covered in different sections.
Let's get connected! Join the Learning Community Preview 00:26
Section 1 Introduction Preview 01:28
Introduction for the first section of the course where I will compare Git and GitHub
PDF - Introduction to the Git and GitHub Preview 00:02
Git vs GitHub Preview 05:30
What is the difference between Git and GitHub? Let's discuss it in this lecture!
Section 2 Introduction Preview 00:42
In this section you will install Git on your computer and configure Shell
Installing Git on MacOS Preview 02:24
If you use Mac OS this lesson is for you. I will show you how to install Git on Mac.
Installing Git on Windows Preview 10:41
If you use Windows, this lecture is for you. I will show you here how to install Git on Windows.
Installing Git on Linux Preview 08:20
Installation of Git on Linux is very simple. In this lecture I will demonstrate you how to do it.
Installing iTerm2 on the Mac Preview 05:36
If you use Mac I highly suggest you to install custom Terminal called iTerm2 and use it instead of built-in Terminal.
Installing custom shell Z-Shell on the Mac Preview 05:32
Along with iTerm2 it's a nice idea to install also custom shell called Z-Shell. In this video I will guide you through this process.
Section 3 Introduction Preview 00:43
In this course you and I will heavily use Shell. In this section I will show you basic commands that you will use for different operations like creation of new folders, files etc.
PDF - Basic Shell Commands Preview 00:02
Shell commands - directory management Preview 09:38
In this lecture I will demonstrate you how to perform directory management in Shell.
Shell commands - file management - PART 1 Preview 08:59
In this lecture I'll demonstrate you how to perform file management using Shell. You will learn how to read files the how to edit files using such editors like Nano.
Shell commands - file management - PART 2 Preview 08:25
In this lecture we will continue discussion of file management commands in Shell and the I'll demonstrate you some examples.
Section 4 Introduction Preview 00:57
It is very important to understand how Git works under the hood. That's why let me quickly go over topic we will discuss in this large section.
PDF - How Git works under the hood Preview 00:02
Initialize new Git repository Preview 04:12
First step in the management of repositories is the creation of the new Git repository. In this lecture I will show you how to perform initialisation of the new Git repository.
Overview of .git folder Preview 04:01
After initialisation of the new Git repository you will see that Git will create .git folder. And in this lecture I'll show you contents of this .git folder.
Git object types Preview 03:02
Let me now explain you which object types Git could store in the .git folder.
Writing new Git object with git hash-object Preview 06:45
It is possible to insert the new object into the Git repository with git hash-object command. And in this lecture I'll demonstrate you how to perform this task yourself manually.
JSON vs Git database Preview 03:57
Structure of the Git repository is very similar to JSON structure. And in this lecture I'll demonstrate you what are the similarities and what are the differences between JSON and Git repository.
What is hash function Preview 03:52
Every object that is stored in the Git repository is stored with unique name. And this unique name is generated using SHA1 hash function. In this lecture I'll tell you what is hash function and how it works.
Hash functions overview Preview 03:29
There are different hash functions available. In this lecture I will explain you difference between some hash functions and tell you which hash function is used in Git.
SHA1 Hash Function Preview 10:18
SHA1 hash function generates hash that is 160 bits long. And exactly this hash function is used in Git for creation of the unique id for every object like Git blob, tree or commit.
How many files Git could store Preview 04:09
You already know that Git creates unique hashes for every file that is stored in the repository. And here I want to explain you how many files in total Git could store in the Git repository.
Probability theory in Dice game Preview 04:11
Let me know get the back to the very simple Dice game and explain you some basics of probability theory and how it could be applied to Git.
Git hash collision probability Preview 05:56
Let me know talk about the probability of getting exactly the same numbers in the Dice game and same hashes in the Git repository
Next lecture is OPTIONAL Preview 00:27
More details on hash collision probability (OPTIONAL) Preview 27:13
Exploring Git objects with git cat-file command Preview 05:24
It is possible to read Git objects using specific command that is called git cat-file. With this command you are able to read the contents of specific object in the Git repository. Also you are able to read the type of the object and it's length.
Create new Git Blob based on the file Preview 07:56
In this lesson I'll demonstrate you how you are able to create new Git blob in the Git repository from the contents of specific file.
Git blobs don't store filenames Preview 02:40
In fact Git does not store file names along with every blob. Every blob has unique filename that is based on the SHA1 hash of this file. That's why Git needs to store filenames somewhere else.
Contents of Git objects Preview 10:14
Every Git object has specific structure. Git stores following data in every object: type, length, delimiter and content.
What we have so far Preview 01:56
We have just discussed some internals of Git and now you know how Git stores every object in the Git repository.
Tree objects in Git Preview 02:41
There are four different types of Git objects. They are blob, tree, commit and annotated tag. Let me now explain you what is the purpose of the tree objects in Git.
Git object permissions Preview 02:25
Git tree object stores actual filenames and SHA1 hashes for every blob. Also it stores file permissions of every blob. In this lecture I want to tell you about the different possible object permissions.
Creating Git Tree object Preview 09:52
You could create new Git tree object manually. Now let me demonstrate how you are able to do that.
Examining Tree Object Preview 04:52
Let's now examine contents of the Git tree object.
Working directory, Staging area and Git repository Preview 01:55
Let me know talk about the difference between working directory, staging area and git repository.
Overview of current files distribution Preview 03:50
Let me now show you where all files that we have created before are located in terms of working directory, staging area and Git repository.
Git read-tree Preview 03:51
Let me know show you how you're able to use such command as git read-tree.
Read files in the staging area using git ls-files Preview 01:58
Sometimes it's useful to read files that are located in the staging area. You could read the files in the staging area using command git ls-files.
Git checkout-index Preview 03:11
You could move files from the Git repository to the staging area using command git checkout-index.
How many folders could be created for objects Preview 02:20
Let's now calculate how many different folders could be created in the Git repository
Section Summary Preview 04:20
Let's now summarise what we have discussed in this large section dedicated to the Git internals.
Section 5 Introduction Preview 00:53
In this section we will talk about the basic Git operations. I will explain you how to create a new commit, how to perform management of the git repository, how to add the files to the staging area, how to remove files from the staging area and so on.
PDF - Basic Git operations Preview 00:02
What is Commit Preview 03:59
Let me now explain you what is commit and why it is needed.
Configure Git author name and email Preview 03:50
Before starting using Git you should configure global Git name and email that will be appended to all commits you will make.
Creating first commit Preview 04:00
Let's now finally create you very first commit in your very first git Project
Exploring commit object Preview 05:36
We have just created the very first commit in the Git repository. Now it's a good time to explore contents of this commit object.
Current project state overview Preview 05:08
Now let me briefly overview current state of our project.
Basic Git commands Preview 03:34
We have just created very first commit in the repository. Now let's talk about basic Git comments like git status, git log and git checkout.
Adding new file to working directory Preview 05:43
Now let me demonstrate you how you're able to add the new file to the working directory in Git.
Git files lifecycle Preview 08:37
Every file has its own lifecycle and there are several possible locations where files could be stored in Git. File could be located in the working directory, staging area or repository.
Stage file Preview 01:59
If file is already located to in the working directory you are able to stage this file and move it to staging area as well. This process is called "stage file".
Unstage file using git rm Preview 02:57
If specific file is already present in the Git staging area you are able to remove it from the staging area using git rm command
Commit changes Preview 02:07
If some files are already present in the working directory and staging area it's a good time to commit them. And here I'll explain you what happens when you commit changes.
Exploring changes in Git repository Preview 07:53
As you see every file in Git could be either untracked or modified, or staged, or unmodified. Let's now explore changes in our Git repository.
Current diagram of Git repository Preview 06:15
At the moment in the Git repository there are two different commit objects, two different tree objects and three different blobs. Let me explain you all of that using a graphical diagram.
Section 6 Introduction Preview 01:12
In this section we will talk about the Git branches and Git HEAD. I will explain you how to create a new branch of how to switch between different branches
PDF - Git branches and HEAD Preview 00:02
Most common Git operations Preview 06:17
No I will explain you how to move files between working directory, staging area and Git repository. I will show you how to use following commands: git add, get commit and git checkout.
Overview of the current project state Preview 01:23
Let's explore the structure of the project at this moment of time. At the moment there are three different blobs, two different trees and 2 commits.
Installing GitHub Desktop Preview 03:36
GitHub Desktop is a very useful GUI application and using the GitHub Desktop you could easily manage multiple Git repositories and perform different Git actions.
GitHub Desktop Overview Preview 04:58
Let me now explain you most common features of the GitHub Desktop and I'll explain you how to add Git repository and how to explore it inside of the GitHub Desktop
What is branch in Git Preview 06:44
Branch in Git is a simple pointer to specific commit and in this lecture I'll explain you features of the branch in Git
What is HEAD in Git Preview 05:31
In Git there is specific term called HEAD and in this lecture I will explain you what is HEAD and how it is used in Git
Third commit Preview 05:22
At the moment there are two different commits and now it's a good time to create one more commit and afterwards we will explore changes in Git repository after this third commit
Git repository changes after third commit Preview 07:12
We have just created one more commit in the Git repository and now let's explore what was changed in the repository after this last commit. There will be actually one more commit object and one more tree object.
Checkout specific commit Preview 13:49
Now you know that the HEAD points to the currently checked out branch. In this lecture let me show you how you could checkout specific commit by using its SHA1 hash.
Why do we need branches Preview 10:36
Let me now explain you why we need branches. Branches are needed if you want to work on multiple features in the same project in parallel. And branch is simply pointer to the specific commit.
Git branches management Preview 03:04
Let me now quickly explain you how you could manage multiple branches in the same Git repository.
Create new branch Preview 07:20
You could quickly and easily create a new Git branch by using the git branch command. Also you could use a git checkout command with option -b in order to create new branch and immediately switch to this newly created branch.
Commit changes in the new branch Preview 04:35
Let's now create new branch and switch to it. Afterwards lets make some changes there and commit those changes.
Explore commit in the new branch Preview 05:31
We have just created a new branch and made some changes in this new branch. Afterwards we have committed those changes. Now let's explore changes made in the last commit in the new branch.
Git reuses blobs with the same contents Preview 07:34
Now let me talk about very important Git feature. Git re-uses blobs with the same content. There is no need to create new blob if there is already blob with the same contents in Git repository.