Git Tutorial for Beginners: Mastering Git Essentials (the 80/20 of Git) - A Git Course

preview_player
Показать описание
In this video you will learn the 20% of Git commands that will give you 80%+ of the benefit. This course starts from the ground up. No prior git experience is necessary. I'll show you how to create a repository, add commits, review the repository, branch, merge, push to remotes on GitHub and much much more.

This is the only course you'll need to get started with Git.

Learn Git Fast. In less than 2 hours!

You will learn how to use the following commands:
- git status
- git init
- git log
- git add
- git commit
- git checkout
- git merge
- git branch
- git stash
- git clean
- git cherry-pick
- git push
- git pull
- git fetch
- git diff
- git mergetool
- git show
- git clone
- git remote

I do not step outside of these commands in over 95% of time in my career as a software developer.

Links:

00:00 Intro
01:10 What is Git?
07:50 What can Git store?
08:40 Storing large files in Git (Git LFS)
11:08 The 80/20 of Git commands
13:00 The Terminal Environment
14:04 Checking your version with `git —version`
14:39 Using `git status` in an empty directory
15:20 Creating a repo with `git init`
16:25 The .git folder
18:00 Understanding `git status` in a newly initialized repo
18:20 Adding and committing with `git add` and `git commit`
21:12 Inspecting the files in a file explorer
21:39 Viewing file changes with `git diff`
23:50 New & modified file statuses with `git status`
24:48 Understanding and saving time with `git commit -am`
29:15 Diffing with an external tool (VS Code GitLens)
32:47 How `git commit -am` helps you
33:44 How git tracks changes in files
36:09 Viewing commit logs with `git log`
37:26 Short git hashes with `git log —abrev-commit`
39:37 Viewing the current branch with `git branch`
41:20 Creating branches with `git checkout -b`
42:40 Managing files in different branches
45:06 Why branching matters
46:15 Branch naming (feature, bugfix, hotfix)
49:47 Fixing a bug in a branch
50:44 Merging branches with `git merge`
54:12 Deleting branches
56:23 Merging master into a branch with a merge commit
1:01:07 Diffing between branches
1:03:42 Merge Conflicts - Forcing a merge conflict
1:07:22 Inspecting Merge Conflicts with the CLI
1:09:06 Resolving Merge Conflicts with VS Code
1:10:34 Resolving Merge Conflicts with WebStorm/Android Studio/IntelliJ/PyCharm/etc
1:12:45 Resolving Merge Conflicts with `git mergetool` and an External Tool (DiffMerge)
1:14:43 Committing the merge conflict changes
1:16:26 The .gitignore file
1:21:12 Understanding git remotes
1:22:04 Adding an origin remote with `git remote add …`
1:23:57 Pushing to a remote repository with `git push`
1:25:13 Pushing a branch to a remote
1:25:59 Creating a pull request on GitHub
1:28:59 Reviewing and Merging a Pull Request on GitHub
1:31:19 Diffing between local and remote repositories
1:31:45 Fetching changes from a remote with `git fetch`
1:32:25 Pulling the changes from a remote with `git pull`
1:32:38 Cleaning up local branches
1:34:00 Starting a new feature
1:35:00 Create Pull Request Shortcut
1:35:18 Merging the Pull Request and pulling the changes locally
1:35:53 Inspecting the logs to view branch and merge history
1:36:31 My `git lg` alias
1:37:52 Using `git show` to inspect a commit
1:38:16 My git configuration file
1:39:48 Viewing authors with the git authors alias
1:40:45 Using `git clean` to remove untracked files
1:43:39 Undoing changes with `git checkout`
1:45:21 Stashing and popping changes with `git stash`
1:53:20 Pulling commits to other branches with git `cherry-pick`
1:57:51 Thank you
Рекомендации по теме
Комментарии
Автор

This is not the most comprehensive git course, but it is definitely the BEST!

naserghodsian
Автор

Hi Donn, just noted that the alias cam = commit -am is sometimes not adding files to be committed and you may need to run:

git add .

before the cam alias. If you don't run git add . you get this message on git bash:

nothing added to commit but untracked files present (use "git add" to track)

So I asked ChatGPT which gave me this alias command which is now working fine:

cam = !git add . && git commit -am

This is the explanation - ensures that all changes are staged before committing them. Now, when you run git cam "your commit message", it will first add all changes and then commit them.

tonnie
Автор

Great tutorial. Super easy to follow along and very concise.

justp
Автор

Thank you for this tutorial, came here after listening to the podcast. Learned a lot !

arpie
Автор

Hey donn .your kotlin course is awesome .

amazingtamilmystery
Автор

Thanks for sharing this course, Donn. I like commands/shortcuts and I'm learning a lot of them in this course.

ecmc
Автор

Thanks Donn! I feel like I'm in the Matrix and I just downloaded "Mastering Git" into my brain 🥷🙏💪

joshmay
Автор

Awesome 10/10. Do you plan making more courses, like HTML, CSS, JS, etc? Thx

blackcitadel
Автор

Another way to adding changes to the git is `git add -p` which makes interactive adding all changes by inspecting them and decide if want them. To clean untracked directories we can add `-d` switch to the command `git clean` ;-)

undefine
Автор

Good lesson and good microphone/sound quality :) Thank you !

vediam
Автор

Thank you for the video and your configs files, always an inspiration.

imharshvardhan
Автор

Very valuable course. It is a great reference for git. Thank you!

edipsaln
Автор

What a valuable tutorial, thanks Donn!

henrykissenger
Автор

I learnt Git Aliases, - am staging flag, generating .gitignorefile, git merge 3way conflict resolution and merge tools. Thanks

tonnie
Автор

Sir Keep It Up, You Are Teaching Very Well ...
♥️

EngMuhammadAmmar
Автор

Hey Donn,
Which theme are you using for your Fish-Shell? is it bobTheFish?

akshayashok
Автор

Dear Donn, when I create a new branch in an Android project and make some changes, all those changes will appear on the master branch as well. It doesn’t happen for Kotlin or C++ projects on my laptop. Is there any specific consideration that I’m missing when it comes to Android?

naserghodsian
Автор

hey, so I have vscode and whenever I try to open up a folder in my desktop with vscode it says that "git has over 5000 active change", is there any way to get rid of this?

shobhitchoudhury