In this step-by-step tutorial, learn how to use Git and GitHub for source control management (SCM). We start with Git. What is it? How you can get it running on your system, and how you can start working with it? Then we look at GitHub.com, a platform for hosting and collaborating on Git repositories. By the end of this video, you'll be well on your way to using Git and GitHub. If you'd like to follow along, I've included sample files down below.
📚 RESOURCES
- Sample files to follow along: 1drv.ms/u/s!AmxrofZZlZ-whOIll...
- Official Git web site: www.git-scm.com/
- Official GitHub.com web site: github.com/
- Git and GitHub.com cheat sheet: education.github.com/git-chea...
- Git Reference Manual: git-scm.com/docs
- Git Overview Book: git-scm.com/book/en/v2
- Sample ignore files: github.com/github/gitignore
- Hyper.is Terminal: hyper.is/
⌚ TIMESTAMPS
00:00 Introduction
00:40 What is Git?
02:11 Get Git
03:13 Configure Git
04:55 Get help
05:59 Initialize repository
07:19 Git status
07:53 Track and untrack files
09:18 Ignore files with .gitignore
11:23 Track all files / add to staging
12:07 Commit
13:27 Change files and view differences
16:00 Bypass staging and commit
16:32 Delete / remove files
17:13 Restore files
17:55 Rename files
18:56 View commit history with git log
19:52 Amend commit
20:48 View changes in commits
22:08 Reset to previous commit
22:30 Rebase git repository
23:12 Branches
27:19 Merge branches
27:57 Delete branch
28:30 Merge conflicts
32:16 Typical Git flow
32:37 Set up GitHub account
33:37 Create new cloud repository
35:09 Push local repo to GitHub
37:29 Working with files
38:25 Edit repo details
38:44 Issues
40:17 Pull requests
43:05 Actions, Projects, Wiki, Security, Insights, Settings
44:18 Releases
45:00 Fetch and pull
45:37 Wrap up
🖥️ GIT COMMANDS CHEAT SHEET
Set configuration values for your username and email
git config --global user.name YOUR NAME
git config --global user.email YOUR EMAIL
Set default branch to main
git config --global init.default branch main
Get help on a command
git help COMMAND
git COMMAND -h
Initialize a new git repository
git init
Clone a repository
git clone REPOSITORY URL
Add a file to the staging area
git add FILE
Add all file changes to the staging area
git add --all
git add -A
git add .
Check the unstaged changes
git diff
Commit the staged changes
git commit -m "MESSAGE"
Reset staging area to the last commit
git reset
Check the state of the working directory and the staging area
git status
Remove a file from the index and working directory
git rm FILENAME
Rename a file
git mv (OLD NAME) (NEW NAME)
List the commit history
git log
List all the local branches
git branch
Create a new branch
git branch BRANCH NAME
Rename the current branch
git branch -m NEW BRANCH NAME
Delete a branch
git branch -d BRANCH NAME
Switch to another branch
git switch BRANCH NAME
Merge specified branch into the current branch
git merge BRANCH NAME
Create a connection to a remote repository
git remote add (NAME) (REPOSITORY URL)
Push the committed changes to a remote directory
git push (REMOTE) (BRANCH)
Download the content from a remote repository
git pull REMOTE
📺 RELATED VIDEOS
- Playlist with all my videos on Git and GitHub: • Git and GitHub
- Python for Beginners Tutorial: • 👩💻 Python for Beginne...
- SQL for Beginners Tutorial: • SQL Tutorial for Begin...
📩 NEWSLETTER
- Get the latest high-quality tutorial and tips and tricks videos emailed to your inbox each week: kevinstratvert.com/newsletter/
🔽 CONNECT WITH ME
- Official website: www.kevinstratvert.com
- LinkedIn: / kevinstratvert
- Discord: bit.ly/KevinStratvertDiscord
- Twitter: / kevstrat
- Facebook: / kevin-stratvert-101912...
- TikTok: / kevinstratvert
- Instagram: / kevinstratvert
🎁 TOOLS AND DISCOUNTS
✅ 🎙️ Voicemod AI Voice Changer | 5% off | link.xsolla.com/KZBi89AY
✅ 🌐 Squarespace Websites | squarespace.syuh.net/XYaqYM
✅ 🔍 Grammarly | grammarly.go2cloud.org/SH3nL
✅ 🛍️ Shopify | shopify.pxf.io/XY9rPa
✅ 📋 Notion | affiliate.notion.so/rffva4tr71ax
✅ 🖼️ Figma | psxid.figma.com/lqjg97licpry
✅ 🤖 ElevenLabs Text-to-Speech | try.elevenlabs.io/taqepq60mptr
🎒 MY COURSES
- Go from Excel novice to data analysis ninja in just 2 hours: kevinstratvert.thinkific.com/
🙏 REQUEST VIDEOS
forms.gle/BDrTNUoxheEoMLGt5
🔔 SUBSCRIBE ON KZhead
kzhead.info?...
⚖ DISCLOSURE
Some links are affiliate links. Purchasing through these links gives me a small commission to support videos on this channel. The price to you is the same.
#stratvert
I usually don't comment on videos but this one has honnestly got to be one of the most helpful I have ever watched. Thank you very much!
I agree!
I concur
I have seen a good number of Git and GitHub tutorials on KZhead and elsewhere, and I can honestly say this one is by far THE BEST. Detailed and not overwhelming for a beginner. Thank you Kevin!
Exact how i feel. Thank u Kevin !
I agree!
Agree 100%
Exactly!
I totally agree, the details are suitable for a beginner
Thank you for providing this beginner-friendly tutorial, unlike many videos out there that are not accessible for beginners and assume prior knowledge. I appreciate the clarity and helpfulness of your content.
the deeper get into the video, the more I appreciate.
This video gave me the perfect start to github. I always love a Kevin Stratvert video. If I search for any topic on youtube and I find Kevin Stratvert I don't look at other videos I directly come here. Kevin Stratvert is one of my go to youtube channel. His voice is so calm as well
Kevin, this video just made my life easy! I was searching for quick tutorials on git and most of the ones I found were in the range of 2hours+. When I saw this one which was less than 50mins, I jumped on it and once I started watching I was glued to my screen till the end. Your teaching is epic! No BS! Straight to the points. You just won a Disciple.🙌
You couldn't be more right. I just finished a one hour tutorial and he didn't even talk about branches (but he does have a 5 hour paid course on his website). Also you can watch this at 1.5x or 1.25x comfortably (with pauses for taking notes or running the code)
well said
I agree! Great content !
Thanks buddy. You hit the nail. No more to add. :)))))
@@nicomalGG
As a newbie to Tech, this was so clear in what currently seems like a very confusing and unfamiliar zone. Thanks for the great tutorial!
Person like me who always wanted to learn about git and github but had no knowledge at all and didn't know where to start from. This video just gave me a very good start and now i know what to do with all my Powershell scripts. Cheers Kevin!
The road to good to perfect is way longer than the road to average to good. The amount of hard work and time invested in this video (and every other videos of you as well) can be inferred from how you have focused on details. Look at the how perfectly he has integrated KCC in this video, provided link references for further learnings, listed out all the commands he has used in the description. That's a professional work + great teaching.
Hands down one of the best channels on KZhead. So detailed yet so simple to follow along. Thanks a lot Kevin, you are great a teacher.
Small thanks from me 2
I have been searching for the most concise and accurate tutorial on git and GitHub. After watching this video, I got all I needed. Thank you, Kevin, keep up the good work.
Was trying to search for github tutorials and your tutorial was by far the best. Clear, simple and easy to understand. I appreciate your time doing this tutorial, you got a new sub!
Kevin, as usual you do a great job of putting these videos together. I have tried to watch several other git videos but this one is the clear winner.
I just needed a quick guide to help me with my initial setup. At first I was like 46mns, man I hope what I need is at the beginning. The video is so thorough and well paced that not only I finished all 46mns but had to like and subscribed without seeing another video. This was amazingly well done. Kudos!
I went from zero to somewhat GIT-competent just from this short tutorial. Really good, I appreciate that it dives right into it. Thanks!
Made a complex topic look so simple. Very well paced. Brought in all concepts and developer workflow with the same example. Brilliant. Thank you Kevin.
This is not only the best Git tutorial I've watched but one of the best tutorials for devs in general 👏
A true educational masterpiece! Thanks for your time and hard work
I didn't understand Git and GitHub well until I found this tutorial. Thanks, Kevin!
You don't need to remind any one to subcribe to your channel, every one will love to subscribe 10 times plus after watching your videos, you are a great /born teacher. Thank you so much for sharing for free
Thanks, Kevin. In my search for a tutorial that is both concise and short, your video really fits the bill.
Thanks a billion for this tutorial. You cut through the chase, went straight to the point and made it so easy to understand
Always had a problem understanding what STAGING is, by you calling it a 'Holding Penn' you took all of my frustration away. You are a genius Kevin!
Excellent explanation Kevin, so well-structured and pedagogically well presented. Many thanks!
Thank you, Kevin, for this wonderful tutorial. It was very clear and concise. You have covered the topics in such a flow that everything seemed very easy to understand. Thank you, once again. Great work!
Excellent tutorial, Kevin! I've seen other tutorials on Git before, and I find this quite clear and useful! Thanks a lot!
Great teaching Kevin, I really appreciate your dedication in helping us learn - no one explains it like you do ! Keep it up ....
This is an incredible video. It may be a little different sometimes (such as git checkout instead of git switch on older versions, possibly, ymmv), but overall it's a big help to anyone just starting their Gitventure.
Great video Kevin ... and this is coming from a senior developer who uses Git on a daily basis ... I can never get enough of Git videos. I always learn something new :-)
The best tutorial on git and github. So much information in so less time, yet so understandable. Subbed and hell I'm clicking all those ads for you!!
Deeply appreciate the hard work you put into this....Very exhaustive, thorough and apt. The best you got here
Kevin, you are the best at simplifying this content for new users, I appreciate it so much!
Great tutorial on the basics of Github, very straight forward. Pace and production quality were spot on.
it's hard to not enjoy this topic when your enthusiasm emanates through the video. Thanks for the tutorial. Thanks to you, I know how to use shotcut, balabolka and now git. I may have missed other software but you really know how to make tutorials
One of the best Git Tutorial I saw on KZhead. No hand waving unorthodox layout and OS like the most popular video that make it impossible to follow along.
This is the only tutorial that I was able to follow through successfully each step till the end! I've watched a few other videos and all suffered the same fate, got stuck in a particular step that they showed and couldn't proceed. Thank you so much Kevin!
Dear Kevin I am doing Masters in Computer applications. I have been watching your videos for a long time and I really like videos. couple of days I decided to learn git and GitHub after watched some videos on KZhead I got so board I was think that I wish kevin should have a video on git ang Github finally I today I saw the video on your channel I am so happy to watch it Thnank you so much
I learning how to use Git and GitHub, I feel this is a one stop tutorial. I am just watching it over and over
This is the best Git & GitHub tutorial available and it's not even close! The fact that you didn't use any code editor magically demystified Git for me. Subscribed!
I just want to let you know every time I search about anything, you don't know How happy I am, just to see your face, or your uploading a video about the things I want to learn. Keep up where you are the best.
Absolutely fantastic! Huge fan of Git and GitHub. This kind of content is needed.
This was a really comprehensive overview mate! Really impressive. I not only now know how to install, edit, construct repositories correctly and efficiently in the Git style, but I also now know to connect to GitHub. Most importantly of all, I now know why I'd bother doing any of it at all and how much of a game changer it is for my projects in general and my workflow in particular. I can't remember how the algorithm pushed me along to your video (I think it was a general search for System Analysis and Design re: Uni project) but I'm so glad it did. Liked and subscribed 😊
I've been messing around with git for about 4 days, it was not going well. This video helped A TON. Thank you. I am very glad you started from the basics of getting git working first on my local computer.
Man you are so gifted in teaching. This is what I lack in many youtubers. Thank you so much for this amazing video. Keep rolling!
Thanks Kevin for such a neat and organized tutorial. Thanks for for everything I learnt from you and will learn in future.
Fantastic video Kevin, it is designed very systematically to understand the entire flow of GIT and GITHUB perfectly ...Thanks for the video
Omg, the best git and GitHub tutorial...you saved form confusion and saved me time too. The delivery was very good. Thanks man.
Not even finished watching but every time I have a question Kevin answers it right away. This is great, kudos!
excellent tutorial Kevin! you are unique in your teaching styles. I have watched several videos on this topic, but l always end up confused, thank you for great piece.
you explained everything so easily! You are a very good teacher.
OMG! I have watched so many videos but nothing like this. Thank you so much, This video is just pure gold, straigth to the point.
Just pushed 3 projects that were giving me hassles for the past 3 weeks. Thank you for clear guide. You're the best!
I play classical music for my chickens
When you say you're chickens, do you mean pet chickens that live with you? Or chickens that you use to get eggs and eventually kill?
What is the instrument you play it for your chickens
Thanks for another excellent educational video. Clear, well laid out and easy to follow along.
i'm just halfway through the video but i'd like to thank you. you'll never know how grateful i am to you.
first time i watched git and git hub tutorial completly in one go.. best tutorial ..
This man is a great Teacher. He can simplify concepts a lot, just like CoreySchafer, a great Python programming instructor. Weldone sir
A really well thought out , easy to follow and comprehensive tutorial. Thank you.
Thanks, Kevin! You make every subject seem easy and doable.
This is the most complete and easy to catch up GIT guide I have encountered on YT! Thanks man!
9:54 If anyone had the same problem as I did where I couldn't change the file extension, click View -> Show -> File name extensions :) Edit: just finished the video. Absolutely fantastic!! You taught a lot of the things they didn't teach us in our Python classes, thank you!
You are a real one for that! I was spending like 30 mins remaking the file trying to understand why it was not working!
thanks man
tysmmmmmmmmmmm broooo!!!!!!
i cant find a "show" in my view tab. you know what i should do?
In your view tab, there should be a show tab which contains hidden items , navigation panel, file extensions options etc bro. @@Jameshowardadventures
Kevin is really a great teacher.
Thank you, Kevin! After watching your video, I have been able to understand the first chapters of the Pro Git book. I really appreciate the clear and didactic way in which you share your knowledge. Excellent video!!!
My god this tutorial is awesome. Ran through a whole project in no time. Great stuff.
You’re incredible and such a great teacher!
Thank you! 😃
@@KevinStratvert too many clicks and stuff to remember. Computers are supposed to be getting smarter,.
Mans living in an alternate reality
thanks Kevin!!! I just fetched and merged knowledge from this video
Best git tutorial ever. This is the first time I understand git easily. Thanks.
This is a guide I regularly refer to for working with git and Github. Appreciate the simplicity!
For users having an issues with the master/main change sticking, you may need to run "git config --global init.defaultBranch main" rather than "git config --global init.default main"
Kevin, I didn't even know about these things until now! You are a really good teacher and I am so glad you decided to quit Microsoft and become a full time KZheadr because you have been making technology a lot simpler for people like us!
In 5 years of trying to watch a video to learn about github etc, this one is the last one standing. Well done haha
One of the most well put together, comprehensive, and pleasant videos to learn something. You are awesome sir, thank you.
Hey Kevin you know what, I was just thinking this morning to storing my scripts in Git and thought to see some videos on Git to explore in detail. But here you are, this might be the butterfly effect, my thought here reached to you and you've uploaded what I wanted. Amazing. . . !!!! BTW, thanks a lot, loving your content. Keep rocking.
also me github making roblox scripts GO BRRRRRRRR
Great tutorial, hands down the best one I've seen so far! Heads up though! For some users, including myself, the command for renaming the default init branch wasn't working. Correct bash command was: git config --global init.defaultBranch main very subtle distinction but it worked for me!
@prism_schism I tried both and neither worked for me. @KevinStratvert your video is EXTREMELY helpful otherwise - do you have any other suggestions?
@melissakinney7896 In newer versions of git when installing it on your machine you can specify the name of the default branch to be main. So if nothing helps, I'd recommend just reinstalling git and specify that.
Thanks. I wish some boot camps made their tutorials as easy as yours. It was quite easy to follow what you are demonstrating. You have taught me all I need to understand about Git and Github today and even stuff I will be using in the near future. Well done.
Thank you, I kept on delaying more about Git as I found the content of other videos and the process of using GIT quite daunting. You made it look so easy I am not wondering what I was afraid of. Great video!
I need to learn more about database because the country where i live they need more people who are graduated IT Course and knows well about DATABASE
Please what country if I may ask. I have a background in IT. Can we link up.
M
Emil.. Om att. Mm M I'll keep.
@@nitrotech9701 Dubai - UAE 🇦🇪
How your level in 8 Moonth?
If anyone is having issues with the .gitignore part............avoid saving the file as a text file (it needs to be saved as a file with no extension through which ever editor you use)............using Notepad didn't work for me (even when trying to resave the file by encapsulating the file name within double quotes).........I basically had to open a new file in Notepad++ (do not create the file within File Explorer as it will likely use Notepad by default)...........I then saved the file with the filename between quotes after creating the new file through my Notepad++ editor..............and it worked.
Thanks so much, this solved it.
Thank you!! Worked for me as well
Wow. you are one of the best educators out there. I followed your Fusion 360 videos a couple years ago also. I still pull some of them up from time to time to refresh on a technique.
You're to be commended for your efforts, [!] I've learned so much from you, in just the first video alone, "it's amazing!" Thank you so, very much, for Your help and taking the time to bless mankind with your Teaching!!! Your easy to learn from and as I see it a plethora of information. Teachers need to be appreciated as much as we as a whole can do!
This is NOT for beginners, you talk like we're supposed to know every concept you say, which is not the case for most people getting started in programming world. And I'm saying this as an experienced programmer, not a noob.
@Kevin Stratvert you have such a gift for explaining things. Thank you so much for starting from beginning and organising the material in small relatable units.
Thanks Kevin, This is a well presented GIT tutorial, by far one of the best on KZhead . Easy to follow , and understand.
I've been looking for an easy-to-follow video for learning about git and github and this is by far the best I've seen yet! Thanks Kevin :-)
This took me two hours to complete but it made my understanding of Git and GitHub so so muc better. Thank you so much for the sample example.
This was an excellent tutorial. It finally demystified Git and Github for me, and took me through a project, so now I have some experience, and it was quick and to the point. Thanks so much.
I’m a complete beginner and this tutorial is so good. After watching so many videos and I got stuck, this helped out! Thank you very much
I really like people who are good communicators and teachers, some of us pay attention to teaching style and detail and the ability of the teacher to communicate the information, you have this ability, please keep going, you will help alot of us! Thanks for your efforts!
The 'for dummies' break down of everything is very much appreciated! I'm a student majoring in software engineering and aside from learning basic coding in a hand full of languages I feel like i haven't learned much on "how to be a software engineer" seeing the breakdown of the basics of how Git and GitHub are utilized helped me get a better picture. Is there a part two to this video discussing more advanced ways of using Git / Github? or a video from another channel that you would recommend? Thanks for the awesome video and Thanks in advance for the continued help!
If i am to rename this video, it's gonna be life made easy....one of the best i have seen so far! Many thanks Kevin.
Very structured and easy to follow along even a 40+ year old newbie can understand. Thank you very much.
brilliant. Ties together all the elements i was shown randomly at work in a logical easy to understand order. Thanks Kevin
I am just starting to learn some different programming languages and I had no idea how github actually worked or how to use it. This was such a clear and concise explanation. I really really appreciate it 😊
i am trying to learn the basics very very basics but even what i percieve is the easier stuff most of it i just having hard time making it make sense...i need to learn in a way where every thing is broken down and explained i cant yet find stuff that explains in a way that i will learn so far ive learned that html is the structure that css makes things look nice and java script is concerned with actual function now that i understand so far please pray for me im determined to learn.
That was an absolutely easy-to-follow and fully understandable video tutorial! Many congrats! As we say in Greece "Μπράβο φίλε! Καταπληκτική δουλειά!". Thank you so much!
Fantastic tutorial. Thank you for the hard work and effort Kevin.
Glad I found your video. It gave me a solid basis to start with for understanding Git / Git Bash and GitHub . All without getting lost in too much details and also a video not lasting 8 hours or more 👍
I am a noob an started programming like a few weeks ago. I have made steady progress and made a few projects but I heard is good to show your contributions in GitHub. I didn't know what Git hub or for that matter Git were. This video has been excellent to help me understand how to work with git, how projects are approached in real life and how to combine this in git hub. Without knowing it I have discovered a tool I didn't know I needed. Before this I had copies and copies of projects at different stages in case I had to go back, which is essentially the function Git takes care of. Idk why I think is so cool when you switch from a branch where you are doing new stuff back to the main branch and in the file viewer the files change accordingly.
This is genuinely one of the best Git & Github tutorial! Thanks !
Thanks a lot for this tutorial: Easy to understand, not overwhelming, practical with no fluff.
One of the best, if not the best, tutorials I've seen. Thanks for this.