Git and GitHub Tutorial for Beginners

1,186,535
0
Published 2022-06-24
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-whOIll3D3rv-iWMxqYw?e=JsqfM…
- 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-cheat-sheet-education.pdf
- 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 Beginners Tutorial  
- SQL for Beginners Tutorial:    • SQL Tutorial for Beginners  

📩 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: www.linkedin.com/in/kevinstratvert/
- Discord: bit.ly/KevinStratvertDiscord
- Twitter: twitter.com/kevstrat
- Facebook: www.facebook.com/Kevin-Stratvert-101912218227818
- TikTok: www.tiktok.com/@kevinstratvert
- Instagram: www.instagram.com/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 YOUTUBE
youtube.com/user/kevlers?sub_confirmation=1

⚖ 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

All Comments (21)
  • 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!
  • @mattster6119
    I have seen a good number of Git and GitHub tutorials on YouTube and elsewhere, and I can honestly say this one is by far THE BEST. Detailed and not overwhelming for a beginner. Thank you Kevin!
  • I can't even begin to explain how grateful I am to you for this amazing video. You made things look so easy. Thank you for all your time and hard work.
  • @mrprofomedia
    the deeper get into the video, the more I appreciate.
  • @jodi8076
    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!
  • @is-gm6hg
    A true educational masterpiece! Thanks for your time and hard work
  • @rijwanalam4282
    I have seen lots of Git and GitHub tutorial on YouTube but this is the excellent and very helpful for me (beginners) Thank you ❤❤
  • @rishdhisabith2585
    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
  • @chocodonuts3644
    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.
  • @EcnerYT
    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!
  • @chaerw
    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.
  • @savvy_fred
    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.
  • 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.
  • 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.🙌
  • @pmarc65
    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!
  • @yoip1234
    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!
  • @PabloZumba
    Thanks, Kevin. In my search for a tutorial that is both concise and short, your video really fits the bill.
  • @rocco9t9
    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.
  • @blurryface616
    Hands down one of the best channels on YouTube. So detailed yet so simple to follow along. Thanks a lot Kevin, you are great a teacher.
  • @Chacha355
    Thanks a billion for this tutorial. You cut through the chase, went straight to the point and made it so easy to understand