Git Tutorial for Beginners: Command-Line Fundamentals
Vložit
- čas přidán 5. 06. 2024
- Git is the most popular version control system out there and for good reason. In this video, we'll go over the basics of what git is and how to use it within the command-line. There are several GUI tools out there to help you get started with git, but it can be extremely beneficial to learn git from the command-line as early as possible.
Some of the images used in this video are from the "Pro Git" book. These are licensed under creative-commons. You can find the book at:
git-scm.com/book/en/v2
✅ Support My Channel Through Patreon:
/ coreyms
✅ Become a Channel Member:
/ @coreyms
✅ One-Time Contribution Through PayPal:
goo.gl/649HFY
✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
✅ Corey's Public Amazon Wishlist
a.co/inIyro1
✅ Equipment I Use and Books I Recommend:
www.amazon.com/shop/coreyschafer
▶️ You Can Find Me On:
My Website - coreyms.com/
My Second Channel - / coreymschafer
Facebook - / coreymschafer
Twitter - / coreymschafer
Instagram - / coreymschafer
#Git
I would strongly advise to watch the whole video because it's a great source of information, but for those reviewing the content or looking for a specific concept, here's an overview:
0:00 - Introduction
1:31 - Distributed vs Central Version Control
3:17 - Installing Git
3:39 - First Time Setup
6:36 - Getting Started (Local repository)
10:41 - Git File Control
14:55 - Getting Started (Remote repository)
20:37 - Branching
27:38 - Faster Example
29:41 - Conclusion
thanks for the timestamp!
Thank you, Adrian.
Thank you!
Hi, how do u add those time-stamp links to your commit? Any doc?
type it like usual@@tetelim4428
I watched this on May 12, 2020, and it's still the best video to learn how Git works.
With " learn X in Y minutes" kind of tutorials getting millions of views these days, its great to see this no-nonsense, content-first channel. Good job! Keep it up!
Went into this a complete noob and came out 99% noob. Excellent video!!
magnus engø -(99% noob) **
I feel the same! still a lot to learn but more hopeful
@@swaraagsistla8641 he probably meant what he said. There is still a lot to learn and after watching the video I even think that 1% ain't that little...
This was probably one of the most perfect tutorials of any technical subject that I have ever seen. So many tutorials make assumptions that they don't realise they are making and they skip things. This was perfect.
For beginners, this is the best git tutorial you’ll find in CZcams. Period.
3+ years later this video is still super helpful. Thank you very much!
It has become a habit of mine to watch Corey's video in free time instead of Netflix.
Best tutorial I've seen so far and I've been poking around for them for days now. Thank you Corey.
You're welcome. Glad you enjoyed it!
Great
I have to say, your videos are so useful and you have such a good way of explaining and teaching different concepts, subjects and how to's. I have watched and used quite a few of your videos, and found them so helpful and educational. This channel is such a great resource for anyone trying learn more about any of the subjects you have videos about. Thank you for being such an educator and lifesaver!
I know it's been several years since these Git videos came out but I wanted to thank you for them, as they have made a big impact on my comfort level with Git for day-to-day development work in my team. I'm not afraid of Git anymore and I can use it with confidence. Great examples and your clear speaking voice made the material accessible for me. Thanks a bunch, Corey!!
The Odin Project brought me here :)
Yep, its been an awesome website so far.
samee :D hows your journey with TOP been?
@@chan7191 I'm using freecodecamp at the moment, Ill carry on with the Odin project, when I have a better foot into things.
Andrew De Lange thats great! Have fun :)
@@chan7191 AWESOME
Best Git tutorial video I've seen. Thanks!
This is the Best tutorial I've seen so far on Git.... Thank you !
exactly, i have seen tons of videos on youtube but none of them explained as good as this channel
4 years later and this is still the best youtube video on the topic. Thank you
Best I have seen so far about git. Short and clean samples. Simultaneously I followed your steps and did on my own, and that is what I recommend to understand how that works. Don't only watch, instead watch and try on your own. Thank you Corey!
This video completely saved me for the git section of my class. You are the man Corey. Keep em coming.
Been viewing a lot of Git Tutorials lately, but this one is the best by far! Highly recommend for complete beginners!
There are many tutorials out there but it's hard to find one that's to the point, relevant and easy to understand without too many frills and gimmicks. Well done.
Thanks again Corey! This video was very helpful! There was a lot of information thrown out in this video. I was feeling overwhelmed at first, but after taking a break and giving my mind time to rest and absorb what I saw, I rewatched the video again and this time everything clicked! So for the viewers that watch this video, I would recommend watch it once, then take a break and rewatch it until it sinks in. This is a very valuable and powerful lesson.
No one before had explained me in a so clear and straightforward way what git is and how it works. Many thanks Corey, you're a great teacher. Your videos on Python have also been very useful for me, and I just hope you add some C++ tutorials too :) Thanks again!
Such a nice and comprehensible tutorial. I've struggled quite a lot to understand how to use git. Thank you so much for your effort, Corey! :)
Among the other CZcams videos in coding (series tutorials in particular), I found your content more engaging yet straight to the point. Your voice is also soothing and easy to follow; Like when I was watching your Python tutorials, I can anticipate what you "will do" next and then makes me feel like I actually "get it". That is a form of talent - the kind of empathy a great teacher has!
As someone just entering the field of data engineering and version control being so new to me, this was, hands down the best video to explain the concepts. I tried reading some documentation online and watching other videos. But this was the easiest to digest. Thank you so much for putting this together. God bless!
Hello Corey, your tutorial is great! I have asked friends how to work with git and taken other tutorials, but this is by far the best I took! Thanks a lot.
GIt on fast track. Watching your videos == reading 2 to 3 books. Thank you Corey.
Here I'm repeating what I stated at the end of this series of videos: Corey, this series is awesome. It is a great stepstone into this topic ! The examples you had been chosing are of a very great value !
This guy is a legend, a video that is 8 years old is the the best at clarifying git and GitHub
Extremely well made and detailed video! it explains all the basics of Git in a very simple and easily understandable manner. Thank you Corey!
Best git intro I've seen!
Thanks!
By far, the best tutorial on GIT. It's been months I've been trying to wrap my head around commands. This is the perfect tutorial to get anyone started.
Got to say, you are a natural teacher. Very nice explanations, good pace, engaging and easy to follow. One of the best tutorials available on youtube!! Thank you so much :)
Best Video in simplified form. Please keep posting simple but powerful videos. This video shows that no. of views doesn't define the goodness of a video.
+binoy deka Thank you for the kind words!
The 30 minutes video has build my confidence in working with Git. Thanks alot for this
Corey Schafer is best at choosing what is essential for viewer, i think this is the best content
Excellent to the point lecture. I recommend everyone this video as it covers all the necessary git commands with great explanation. Thank you so much.
That is the best git video serires on CZcams still in 2019! Great work, thank you so much!
Thank man, you 're the best instructor in my whole life :)
Best video in youtube to get a good understanding of all the necessary GIT commands. Clear and crisp explanation, Great job.
Thank you so much Corey for putting it all in simple words with proper practical understanding. Highly appreciate you take time in explaining technology and its tools to new bees like me.
I have tons of knowledge when it comes to SVN, so how you presented this video to help me transition was beautiful. Well done, great presentation don't change a thing.
Spent 3 months trying to get git installed properly and ended up giving up. Watched this 30 minute tutorial and now it is set up properly. Who knew?
You're very thorough in your tutorials! Some of the other CZcams tutors ignore certain crucial aspects in their explanations and leave viewers hanging, seemingly forgetting that they're mostly dealing with beginners.
I decided to learn a bit more than the most basic operations in Git. And I am so glad that you covered this topic, as you never let me down. Thank you for doing these tutorials.
The Odin Project brought me here and as an actual NOOB, I am totally lost.
You are lost in which part? You wanna help?
I'm from The Odin Project and I'm learning Git for the first time too
@@marymad4203 me too, i got so lost, i cant seem to find the .gitignore or after touching it, also hard to follow the steps without actually doing it as he speaks
@@andikanakpan8436 I know, it happens sometimes, is normal. You can focus on git init, clone, status, add and commit for now, just to familiarize with git workflow. And the others commands you can learn after you learn these above. I hope it helps you :)
Im stuck on this part as well. Would anyone like to connect on discord and work together?
Thanks a million ! This was very detailed.
I really like the narrative and depth of the details. For a beginner, this is much advanced and very clear. Thanks Corey.
This is the most informative git tutorial I've watched so far! Thanks Corey.
Just want to say that you are the man!!
If our tutor shows us this in class instead of trying to explain it himself this would be so much easier
Without question, the very best explanation and demo of command-line git that I've ever seen. I know that there are a lot more areas that are not covered here but, for a guy that's been in tech for over 20 years and is just learning how git works, this is fantastic! It's funny that everyone assumes that you know all about git and github. But if you don't, it can be confusing and exasperating. This tutorial is great!
Much appreciated for the effort compiling this easy to follow (yet comprehensive) tutorial.
This is the best tutorial for Git. Good job! +1 sub
Great Video. I'm studying a paper on Software Engineering and Design and this video on GIT was more educational and of higher quality than 2 x 1 hour university lectures on the same topic. Thanks
Mr.Corey Schafer the way you teach and your voice always motivates me to learn python and keep moving. Thank you very much for all your content
Perfect video to get started with Git. You have covered a lot in 30 minutes. Thank you very much for sharing your knowledge.
Odin Project brought me here. Even 5 years this video is still relevant and game changer for git noobs like me. Thanks for sharing your expertise.
Ps: What's the service you are using to show slides? Is it selfhosted?
Very nice video, nice and simple to understand example. excellent job.. keep posting such videos..
This is a great tutorial video, the best Git one I ever saw. Congrats to you Corey! I could finally understand what I was doing wrong
Excellent tutorial. Cleared out most of my doubts regarding Git. Thank you for creating such an awesome tutorial.
Great voice for being an instructor
Many thanks for your help and time. This is a great tutorial. Good job!
When I was looking for some tutorials on Git I didn't have to think twice before opening this video. That's where the quality of your tutorials are! Love your tuts!
I would be thankful to you , I entered the programming world by watching your video and I am improving day by day ,I am very much thankful to you.I have recommended your video to all my friends and they are enjoying your content.Thanks Corey
Wow!!! I love this guy! Please be my professor.
I usually don't comment but THIS IS JUST AMAZINGGGGGGGGGGGGGGGGGG Tutorial. THANKS A LOT....................
I always come back to your tutorials. You're the man, bro.
Awesome! Best intro video on git ever! Loved mainly the workflow part!
Best git tutorial on the Internet
is it still up to date? thanks.
Excellent tutorial!
Amazing GIT intro, This is one of the best videos. Thank you so much Corey.
There are "before and after" Coreys tutorials.
Before one may be confused or stuck with a problem.
After things make sense again and the problems get solutions.
Just simply the best tutorials around.
So I've taken some notes for the last "fast example" of the video (the one that concludes all the commands). So, here is the workflow you will repeat forever from now on:
git config --global user.name
git config --global user.email
git clone
git branch my_new_branch
git checkout my_new_branch
(make changes to the code)
git status
git commit -m "Add @function in file7"
git push -u origin my_new_branch
(wait for unit tests to complete)
(if all unit tests pass, then do these)
git checkout master
git pull origin master
git merge my_new_branch
git push origin master
(now time to delete my_new_branch)
git branch -d my_new_branch
git branch -a
git push origin --delete my_new_branch
Got here from The Odin Project. Thanks TOP
i've been looking all over the internet for a great git command line tutorial and it was nowhere to be found on the git website or its linked videos, but i most certainly did find it here. THANKYOU. BEST, EASIEST TO UNDERSTAND GIT CL TUTORIAL ON THE WEB. Why is it so hard to find people who explain programming in regular words like you do? This is so useful.
The best video tutoial on Git Command line on youtube. Great teaching. thank you Corey :)
My brain is so slow that I had to watch your video on 0.75 speed to fully grasp what you were saying.
Thank you from Colombia, the odin project has sent me here :)
me too :)
Super video. There's so much, I had to watch it numerous times, stopping and starting while taking notes.
The most useful thing is that you show the sequence of commands needed to perform a function.
I rarely, RARELY, comment on videos; even ones I enjoy. But this tutorial has made the git workflow so easy to understand that I have to let Corey know how much I appreciate him putting this together. Thanks again!
very well explained...thank you :)
This is one great rich content tutorial you made!!!! (Y) Thanks aloooot!!! :D
Best Git basics tutorial I've been able to find online (video or text).
Undoubtely best Git video out there, very clear and straight to the point. Thank you so much.
Hi Corey, can we skip pushing branch to remote if we don't intend to share it with the others?
I can't resist myself from paying the fees(this is not donating because you are the donor Corey!!).Thank you very much.
I have read and watched some material on git already, but this was the first time, the stageing process was explained properly. Thanks!
I'm thrilled to learn git tutorials! Thank you Corey for great vids.
6:04 How did you get out of/clear the user manual from terminal? Answer: press "q".
Wow. This is so abstract from the perspective of a rookie, and yet, so clear. Why? Corey uses the simplest possible examples at every step, has code ready to change, makes the simplest possible changes, explains everything he is doing, often before he does it and again after he does it. He does not race through everything, hoping to show us how fast or easy some system is or how clever he is. It's so clear, I was able to deduce some properties of git that he didn't even tackle in his exposition. I absolutely agree with Adrian Wilk: Go through the entire video even if you plan to work with git only locally. No matter what you're doing, take the time to study every video CS makes that has any bearing on your goals. NOBODY DOES IT BETTER. Theres no FOO or BAR here. Instead he names the remote repository "origin" to clarify git's checkout and push commands, showing file changes at every step with appropriate commands. Most of the explanatory video on the web is too basic for me now. Why? BECAUSE OF COREY SHAFER. Good morning Corey! I sure could use a video on using slightly advanced query objects in Django to work with related tables. I'm raising your monthly stipend 50%.
Dude, to be honest this is the best video that explained the concepts very clearly. I was having hard time to understand the git and how to work with it. But this tutorial made things clear for me. Thanks a lot for this.
You know what ? whenever i want to learn something in shortest time but highest quality, i search it in your channel !
I think I've officially hit the "wtf is going on" part of learning... Not sure I'm even learning anything, honestly.
same here
me 2
Mash house ya that wud be great. Git makes no sense to me
Likely because you guys haven't stumbled into the problems git solves.
Sorry you feel this way! Learning this stuff, as with anything you're learning for the first time, can be frustrating. Hope me offering some advice isn't seen as presumptuous on my part. In the wild, git is used primarily on teams collaborating on code, but you can use it on your own personal projects to keep track of changes. If I were you, I'd try to start a small project - just something with a few lines of code - and then head over to GitHub. From there, create an account, set up a repository, and commit your code to that repository. Of course, you need to initialize your local repository and "connect" it to the remote one you've set up on GitHub as well. This tutorial gives you most of the tools to do that, but you'll also probably need to Google around a bit.
fk it! Time to binge watch you entire channel.
Hope you become a prof someday... those are some pretty great teaching skills you got there
Just amazing . May be I am falling in love with your way of teaching . I thought I have learned these basics in bits and pieces with the stackoverflow e.t.c but no I learned them after seeing this video . You're the best Corey . You fail to disappoint the beginners like me :)
Thank you for this series on git. Easy to follow, especially for beginners, and it works.
I get an error when I push my cloned repository ...
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: is denied, because it will make the index and work tree inconsistent
remote: with what you pushed, and will require 'git reset --hard' to match
remote: the work tree to HEAD.
remote:
remote: You can set the 'receive.denyCurrentBranch' configuration variable
remote: to 'ignore' or 'warn' in the remote repository to allow pushing into
remote: its current branch; however, this is not recommended unless you
remote: arranged to update its work tree to match what you pushed in some
remote: other way.
remote:
remote: To squelch this message and still keep the default behaviour, set
remote: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To /home/alvise/clone1/../Git_test
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to '/home/alvise/clone1/../Git_test'
Any idea?
I even try git reset --hard
Thanks a lot.....
By the way awesome video...
I got the same error too
i got the same and could not resolve
I'm guessing but it might be an artifact that for the sake of this tutorial we were messing with master branch on both the remote repo and and the clone repo. In general this is not good practice. Branching is a beast unto itself.
This did the trick for me:
"git config receive.denyCurrentBranch ignore" (case sensitive).
5:19 - git config -list
I have seen a lot of git tutorials. But only this one is the best with the real workflow. Thank you a lot. I hope there is some new video from you.
Great playlist, just started learning git and your lessons are really helpful!