Git Essentials - Learn Git & Github from scratch! | Kalob Taulien | Skillshare

Playback Speed

  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Git Essentials - Learn Git & Github from scratch!

teacher avatar Kalob Taulien, Web Development Teacher

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

    • 1.

      Welcome to Git Essentials


    • 2.

      Why the command line?


    • 3.

      Installing Git (Windows Only)


    • 4.

      Installing Git (MacOS and Linux)


    • 5.

      Getting started with GitHub


    • 6.

      Configuring Git on your computer


    • 7.

      Creating and adding an SSH Key


    • 8.

      How to clone a repository


    • 9.

      How to create a new repository on GitHub


    • 10.

      How to push to your GitHub repository


    • 11.

      Git status


    • 12.

      Unstaging a file


    • 13.

      Undeleting a file


    • 14.

      Git origins and remotes


    • 15.

      Git branching


    • 16.

      Committing to a new branch


    • 17.

      Merging a branch into master


    • 18.

      Seeing your Git history


    • 19.

      Downloading updates from GitHub


    • 20.

      How to get updates from GitHub


    • 21.

      Checkout: code-time travel


    • 22. files


    • 23.

      Viewing file differences


    • 24.

      How to ignore files


    • 25.

      Create a custom Git alias


    • 26.

      Fixing Git commit messages


    • 27.

      How to fork a repo


    • 28.

      Git issues


    • 29.

      How to open a pull request


    • 30.

      Undoing a commit


    • 31.

      Force pushing


    • 32.

      How to rebase


    • 33.

      Resolving merge and rebase conflicts


    • 34.

      How to stash code


    • 35.

      Adding tags to your commits


    • 36.

      Final lesson


  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class

Welcome to Git for Everybody! (Git Essentials), the updated version for the modern web developer.

This is a course that will teach you everything you need to know about working with Git and GitHub. And you can use Windows, Mac or Linux — I'll show you how to install Git on all three major operating systems.

By the end of this course you will have the knowledge and confidence you need to work in a team.

I've worked with several teams over the years and everything you'll learn in this course is what I tend to use almost every day and certainly every week.Here's the rough outline of everything you'll learn in this course:

  • How to use Git on the command line (pro tip: it's more important to learn Git from the command line first than it is to learn how to use a visual tool. Servers don't have visual programs)
  • Installing Git on Windows, Mac and Linux
  • How to configure Git on your computer, and add your SSH key
  • Creating, cloning and adding files to a GitHub repository
  • Managing files, commits and branches ⭐️
  • How to merge branches into other branches ⭐️⭐️
  • How to view old files from an older time
  • Viewing file differences and how to ignore certain file types
  • Forking repos (repositories) ⭐️⭐️⭐️
  • How to work on GitHub by:
  • Creating custom branches and tags
  • Opening and managing GitHub issues
  • Opening and managing pull requests
  • How to undo a little work, and a lot of work
  • How to rebase ⭐️⭐️⭐️⭐️
  • How to work through merge and rebase conflicts ⭐️⭐️⭐️⭐️
  • And much much more!

Plus we'll work through lots of real life examples together and get you hands on experience with all of this by creating your own repositories, forking my repo, and even safely opening a pull request on my work for some seriously hands on experience (because Git is better learned by doing).

Meet Your Teacher

Teacher Profile Image

Kalob Taulien

Web Development Teacher


Hi everybody! I'm Kalob Taulien.


Here's the TL;DR (short) version about me:

I have been coding since 1999 and teaching people how to code since 2013 I have over 350,000 web development students world-wide I'm on the Wagtail CMS core development team (Wagtail is Python's #1 most popular website making system) I try my best to answer EVERY question my students have  I love teaching — it's definitely one of my natural talents  Also I love goats! (Great conversation starter with me if we ever get to meet in person)

Below you can find all my Skillshare courses. The categories go from easiest to hardest, except for the Misc. Coding Courses at the very end. 

If you're brand new to coding, start with BEGINNERS WEB DEV.&nb... See full profile

Level: Beginner

Class Ratings

Expectations Met?
  • 0%
  • Yes
  • 0%
  • Somewhat
  • 0%
  • Not really
  • 0%

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.


1. Welcome to Git Essentials: hello and welcome to get for everybody. Or, as I like to call it, get essentials in this course we're going to be learning get from the ground up using just the Commander. I know there are a lot of great visual tools forget, but the command line is more important to know, and I'll talk more about that as we get into the course. And the reason why learning get from the command line is actually much more important and a better skill toe have thin learning it. Using a visual stool for my goal for this course is to teach you all the get that you need to know to work with other developers in coding teams and including open source projects. This is 100% essential when applying core developer jobs. Every developer these days must know. Get now. By the end of this course, you will have lots of get experience and you'll know how to operate. Get Hub Fluent in this course, we're going to create a new git repository from scratch into a bunch of work with along the way, you'll want to share your progress in the project section of this course on skill share. My name's Caleb telling I am a Web developer by trade. I'm also an online instructor, and I use get every single day. It is most used tool that I use on every single website. That I and everything you're going to learn in this course is everything I use on a daily basis. And just for fun, I'm going to throw in a few things that I don't use too often but are still really important to know this course is definitely for you. If you're looking to get into Web development as a career and you don't already know, get. If you already know get this course is absolutely not for you. If you're brand new to get or you're looking to increase, you're get fluency. I would definitely suggest taking this course if you've decided to take this course head on over to that first lesson and we'll get started right away. 2. Why the command line?: first things first, let's talk about why we're learning the command line way instead of learning a visual tool . There are tons of really good visual tools out there for using git, and it actually makes your life a lot easier than learning it from the command line. But the problem is a fundamental problem when you start writing code and you need to deploy it to a server. There is no user interface. There is no visual tool for deploying to a server. A server is all command line. And so, while a visual program might help you learn, get when you're just working on your own computer, when you actually have to work on someone else's computer or working on a server, it becomes very limiting. You won't know how to do anything, because that tool will be taken care of everything for you. Now here's the thing. The command line will always be available to you. It doesn't matter if you're under server, someone else's computer, your laptop, your desktop it does not matter. Get will always be available to you via the command line. You don't need a special program. You just need get by itself So when you're done writing code on your computer, you can get a full copy of all of your code on your server on your friend's computer anywhere else in the world. Now, for those of you who don't know servers actually don't have a graphic user interface, they don't have an interface at all. That doesn't look like your Windows computer. Your Mac computer. It doesn't look like desktop you bun, too. It's just all command line. And so this is going to teach you the command line way of doing things, because this will actually create a stronger foundation for using Get no. Later on. If you want to use a graphic user interface, a gooey that's 100% okay, and that'll be totally up to you. But it's a lot easier to learn command line, way of doing things now and then learn a visual to later than it is to learn a visual tool now and then. The command line way later 3. Installing Git (Windows Only): If you are using Windows as an operating system, you're going to want to download a specific program to use get. This is by far the best program for Windows I found. I've done development on Windows, Mac, Linux, you name it. I've been there. And when I was doing a lot of Windows work, this was the program that I turned to. This was a really, really good program. So you want to go to get for windows dot org's Click your download button here, and this will take you to a get home page, which, ironically, this is actually what we're going to be learning pretty soon as a little kid hub. So if you scroll on down, you'll be able to see we've got file names and stuff in there. We've got assets. You want to download the program? That's right for you know, chances are you want to download get 2.250 point zero 64 bit dot dxy. That's probably the one who wants. Now, if you have an older computer and older Windows laptop for uncensored or an older Windows desktop, you might want to get the 32 bit one But if you've got a newer computer, let's say within the last four years or so, you're definitely going to want to get the 64 bit dot txt file download that install that. And once you have that installed, you'll be able to open a program called Get for Windows. And all that's going to look like is a command line tool something like this. No, my command line tool is unique because I've customized this quite a bit. Yours is going to look very similar, is going. Have some tax and you'll be able to write some stuff in here. But otherwise the coloring might be different. The sides might be different, but all you really need is to be able to type some stuff in here now, a fun thing to do. If you are on Windows, you can always type D I R. And that will show you a list of your files and directories where you currently are something like this to quickly move around. All you have to do is type CD change directories with a sense for change directory. You can see the into any other folder you want, so I'm going to just, for example, a CD into been. And then if I do P W. D. You can see that's the folder I'm in for you. You might want to set up a sample project or an example project on your desktop or in your downloads, or somewhere that's a little more temporary, and then CD into that directory wherever that's going to be, so that you can automatically just start working and we'll do all over. Get inside of that particular folder. So what you have get for Windows installed and you've got your get for Windows Terminal open. We'll get started with the next lesson where we get introduced into get Hub. 4. Installing Git (MacOS and Linux) : If you're on a Mac or Lennix, there are a couple different ways for each operating system to install. Get first things first. Let's go over Mac because more people are using Mac than they are. Linux desktop. So on a Mac, if you have a program called Brew, you can type brew install. Get now if you don't have brew. This is a program called Homebrew, and I would suggest getting this four year Mac operating system. This is really just a package manager, so allow you to easily update get down the road for it, for example, or install other packages that might be related to get or might be related to a particular project. You're working on a really useful tool, so that's Mac number one. Mac Option number two is You can just open up your browser and go to source forge dot net slash projects slash git Dash os X dash installer slash files Scroll on down this page, and you'll probably just want to get the latest one. So this one is get to point to 3.0, and you can see that it's got 30,000 downloads this week. If there's a newer version. Definitely go. Go ahead, get that newer version. But if you see this one, you can also get this one as well. You're going to want to download this, install it, and once you have that up and running, you'll be able to open a program called Terminal. Every Mac comes with this program called Terminal Will. Write that out Terminal. Basically, that's what I'm using here. Now I've got a customised version of my terminal, but your terminal is going to look something like this. Now, if you're on a linen, there's a different way of doing this. So usually you'll type sudo Apt. Install, get, and that will install Get for you if you're in an older version of Lennix or an older version of Let's Say You bun, too. You do sudo apt get install, get and that will install it for you on older versions of you. But you say you want to 12 14 16 something like that. If you're on you bunch of 18 or earlier, it's just sudo. Apt installed. Get If you're on a different Linux operating system. It might be Yaman. Maybe whatever your package manager is, but chances are. It's you're prefects. Whatever your package manager is called install, get something along those lines. If you already on Lin X, chances are you already know how to do this and you know which one to use now, a quick little crash course. If you are brand new to using the command line on Mac or on the Lennox, you can type PWD. And that will show you the the working directory that were that were in that This is really just ah folder name here. So I'm in the root of my computer and then I'm in a folder called Been and To Change Directories and Do CD and C D stands for a change directory And then to list all of your files and folders you can always do ls Dash L. A. And you can see I've got a bunch of stuff in here. I'm going going to see the up one directory a last dash L A and you can see I'm just sort of in the root here. There's nothing fancy going on in here. This is just really folders and a temporary folder in here. We're going to be working with command line a little bit more throughout this course. That's not really get related. So you're going to want to be familiar with CD. Let me, ah, just make that a little bit centred here. You're going to want to be familiar with CD and probably PWD No. And also ls Dash L. A CD to many arguments, cause that's not a command. You have to do one at a time. So it's CD PWD or Ellis Dash L. A. So go ahead, get get installed on your computer. Once you have it installed up and running, you've got your terminal open. Or, if you're on a limits machine, you'll want to open up A program called Bash instead of Terminal Terminal is for a Mac bashes for clinics machine. Once you have that up and running, you can type get dash dash version and it will show you the version of Get that we're using . Once you've done that, let's head on over the next lesson where we get started with Get Hub 5. Getting started with GitHub: in this course we're going to largely be using get, huh? Because a lot of people are using get habits where you're going to find all of your open source projects. We're going to want to create a brand new account. Or if you already have a get hub account, make sure you log into that account. We're going to need access to a get up account. Now Get up is absolutely free. And just so you're aware, moving forward. All of the things that we're going to learn are completely interchangeable with a A service called Get Lab. We can go to you get lab dot com, and you could register there, and you can use get lab instead of get hub. Everything is completely interchangeable. Or, if you wanted to, you could also use a service called Bit Bucket. Can't remember. It's been bucket dot org's and you do the same thing here again. The account is totally free. If you want to pay for extras, you can. You can pay for extra features, but you don't need to. All three of these services are totally free, so I'm going to be using Get Hub and I'm just going to sign in to get up. I already have an account, so I don't need to sign up. But for you, If you don't have an account, make sure you create one. You'll need your user name, email address in your password. Verify the puzzle. So basically, just flip this around or whatever that's capture is going to be. Select your plan. Make sure it's just a free plan. You do not need to pay for anything. And once you have an account, make sure you sign in. The number's gonna signed into my own. Okay, so I just signed into my account. You're gonna see I already have a bunch of stuff going on your feet might be a lot more empty if you're If you have a brand new account, there's not going to be a lot going on here. All you need is to make sure you have that account and make sure you were logged in in order to get to that next step. Once again, if you know about get Hubbard, get lab orbit bucket and you have a preference. You can use any of the other services. These are the three big ones here get hub is the brand name out there. Get Lab is more for private. Use a lot of businesses or using get lab because it comes with a few nice or features that get Hub makes you pay for as a corporation, not as an individual. And there's also a bit bucket, which is sort of the lesser known get service. But it's also a really good service. My preference is always get up, especially if you're trying to build a portfolio out there. If you're trying to build a portfolio, you can see down in my profile here we can see all my different commits. So during the summer of last year, I didn't use get help very much, and you can see, starting in December, it picked up. So, for example, I've got 21 contributions on December 23rd 2019 and what's nice about this is any future employer that's going to be looking to possibly hire you as a developer. They are going to want to see your get have account. They don't care too much about your portfolio. If your websites look beautiful, they want to see your code, and this is the perfect place to highlight your code. So once again, just make sure you have a get hub account. Get lab account or a bit bucket account I'm going to be using get hub. So if your brand new this is going to be easier to follow with, get hub. So go ahead, get that started and I'll see you in the next lesson. 6. Configuring Git on your computer : before we do anything with it, we need to configure it on our command line because right now, if we try to do anything with get or get hub from our command line, it doesn't know who we are. It doesn't know what we do. It doesn't know anything about us. So we're going to need to configure two things we're going to need to configure our name and our email address. And this is just what we consign commits. We'll talk about commits and signing and all that stuff down the road. But basically, every time you write a little piece of code and you put it on, get hub. There's a little signature at the hash, actually, and it has an author, and it needs to know who that author is. So for this, we're going to type get config, Dash, dash global. I make a just a tad smaller here and you can see some of my stuff from above showed up. That's OK, user dot name quotation, and I'm gonna put my name as Caleb telling because that's my name. And then I'm going to type get config, Dash dash, global user dot email, and this is going to be my email address. I put this in quotations as well, and I'm going to write my email address here. You can see that actually wrapped onto another line. That's totally okay if I made the smaller goes back onto one line, so hit enter and that's it. Now that email addresses should ideally match with your get Hub email address, I don't believe it's actually necessary, but it is a better way of doing things if your email addresses all line up. So whatever you signed up for on Get Hub, get lab Orbit Bucket, make sure you're using that exact same email address. No, we can verify that this worked by typing Cat, and that's a tilled slash dot get config. And if I do tab after the word C o N f just tab, it'll auto complete. For me, that file should exist, and now we can see we've got user with a name and an email address. If you do not have this file, that means you're get configures not set up, so make sure you have your user name and your user email set up, and also make sure you have a git config file on your computer. If you have that all up and running head on over to the next lesson, it will talk about adding an ssh key. 7. Creating and adding an SSH Key : when we're using get there are really two ways we can do anything with a repository. And just so I don't jump too far ahead here, I'm going to open up an open source repository here called Wag Tail. Now a repository is simply a place where all this code is hosted. When you see code like this on get hub, get lab orbit bucket. This is called a repository or a repo for short. Now, if I wanted to get this code onto my computer, I have a few different methods of doing that. I can either download the zip, which is sort of the old school method way of doing it or I can use get. Now. There's two ways to do this with get I can clone for you, https. And any time we try to make a change or it has the validate who I am, it's going to ask me for my user name and my email address. That's the user name and email address that you signed up for using Get Hub. Now that's fine, but we're going to be doing a lot of get work, and that's going to get extremely annoying. The second way is using ssh, which basically creates a key on your computer. Just ah, signature, if you will. And it says I am who I am because I had to go and manually create that key. And then we're going to add that kid get hub So it get have always knows that whenever we try to execute some sort of command that it that we are, in fact validated, we are who we are. This is a way of validating your account through the command line. Now, in order to do that, we need to type in really just one command. Ssh! Dash Key, Jen Dash Oh, it's not a zero. That's an O lower case. Oh, now, if you're on Windows, you're going to want to make sure you're using get for Windows and type this. Otherwise, if you're using a different program, you're going to possibly need to run something slightly different. If you're on Mac or Linux is this command should work right out of the box for you as well . So go ahead, hit that. It's going to ask where we want to save this file. I just hit Enter, put it right into my dot s s H folder this route parts going to be a little bit different for you, depending on your computer and operating system. But it should go in your dot ssh folder and to your pass phrase, I'm not going to give it a pass phrase. So just hit. Enter No pass phrase again. Hit, Enter. And now I have an ssh key. Now, this all looks pretty gross. And this actually is not the ssh key itself. What we want to dio is cat This folder in this file, actually, let's go ahead and copy that. Now, that might be different on your computer. If it is, just copy and paste that and we want the i d underscore r s a dot pub. It's our public key. What we're going to do here is we're going to take all of this and we're just going to copy it. Let's go ahead and open up, get hub one more time and let's go into our account settings, go into your ssh and G PG keys and click Add new key. Now, I've got all this blurred out because I have private keys and I don't want even fingerprints being exposed publicly because I've got some stuff that I want to keep private . I'm going to add a new ssh key in here and just paste that in there. That's all I did, literally. Just copy and paste. I'm going to call this get for everybody, slash get essentials and add that ssh key now for scroll down the page. You can see that might get for everybody slash get essentials Key is in here. It's got a fingerprint and the date that I've added it. It's also never actually been used, So you're going to want to go ahead and do that as well. Now, if you don't have access to that cat command to basically print out your file, you can edit that file any other way. You can open it through your folder directory. Just remember that dot ssh will probably be a hidden folder, so you'll need to show your hidden folders. But really, all you need to do is open that file that we created copy and paste and to get up and now get up, knows who we are any time we type the get command and it wants to authenticate us it wants to make sure that we are who we are and that we're not lying about who we are. All we have to do is add that ssh key. Now, if you cannot add NASA's H Key. If that is a problem for you on your computer, what you can dio is instead of using ssh, you can use https, and you can actually see that the U. R L changes. Here it's get Atget hub dot com or, if we use https, https, get hub dot com and then is a regular u R L. So if you were not using an ssh key, if that was a problem for you, for whatever reason, you can continue to use https, and that's totally fine. It's just going to ask you for your user name and your email address every time you want to do something. But by no means should this slow you down. Why you're taking this course once you've got your ssh key in there or you've decided to entirely skip this step, let's head on over to that next lesson 8. How to clone a repository : Let's go ahead and clone a repository. Really? All that means is we have a repository on get hub, get lab orbit bucket, and we want to copy the file store computer. Now again, there's there's three ways of doing this. We can download the zip. We can download it with, get using Ssh or dollars Get using https. Now, I'm just on an example Repo here called Wag Tail. I'm part of the core team, so of course I'm going to use this as a demo. And all I want to do is click this clone or download button and I'm going to be using Ssh. If you don't have ssh set up on your computer, that's OK. You can use the https u R L I'm going to be using the ssh one, though. So open up our terminal and we type get because Oliver get commands. Always start with get the word clone, which really just means copy or download it from get hub and put it on our computer pace that you are Ellen here. And what this is going to do is create a new folder called whatever that repo was called. This is going to create a new folder called Wag Tail for me and if I hit Enter, This is just going to download all of retail. Now, this is a fairly large repo. So it does take a little bit of time. If you have a brand new report or smaller repository, this is not going to take very much time at all. No, I do. Ls Dash L. A. We can see that Wag tail is a folder in here or if I'm on windows, I could do dir and you can see that wag tail is a full during here as well CD into wag tail . And if I do a last dash l a we can see all the files in here. So let's give us a little test. Let's view this Read me files. That's cat read me and oh, we're going to see all sorts of stuff in here. This actually might have been a bad example because it's a little long, So I just scrolled up to the top here and we can see there's an H one in here. Ah Wei tells an open source content management system built on Jango. Let's go ahead and see if that's exactly what it says on Get Hub. Let's open up the read me read me file. Read me dot MD about that age one in there. Wait tells an open source content management system built on Jango. Looks like this is the right one. So that's how we clone now. This does not mean that we can make changes to this code in here and push it up to get Hoven overwrite everyone else's work. There's a whole flow, a developer flow behind that and you need to have write permissions. But for now, you really just need to know what cloning was. Cloning is simply downloading this from get hub, get lab orbit bucket and simply putting it on your computer Now, This also comes with all of its own get history as well, so I could do P w d I can see that wag tails I'm I mean the Wag Tail folder. This is the way till folder I'm in. And if I do get log, we're going to see oh sort of logs in here we can see commits. I'm gonna blur out the email addresses just for privacy. We can see all these different commits, you can see what the commit messages. You can see who wrote anything. You get the entire get history from whatever repository that you clone. So that's clothing pretty much in a nutshell. In the next lesson, we're going to create a brand new repository from scratch. 9. How to create a new repository on GitHub: Let's go ahead and create a brand new repository on Get up again. If using, get lab orbit bucket. It's pretty much the exact same thing we're just using Get Hub as the primary example here . So what I want to do is click this little plus here and create a new repository. I'm going to create it as me myself. I'm the owner. I'm also part of other organizations, so I could possibly create a repository under an organ is an organization that I'm a part of. I'm not going to do that in this case. I'm just going to create a new repository in my own account, and this repository name is going to be get essentials repo out. We don't need to call it Repeal was calling Get essentials and I could give it a description if I want to, and I can say is a public or private. If it's public, everyone will be able to see my code. If it's private, nobody will be able to see your code. Now, if you're creating portfolio, you want your code to be public. Would you like to initialize this repository with a read me file? That's basically the front file that says, Oh, all about this piece of code, all about this project. What's going on in here? I'm going to say no because we're going to add that manually a little bit later. Let's go ahead and create our repository. And now it's asking us to do one of two things. We can either create a new repository from our command line or push and existing repository from the command line. Now, we don't have an existing repository, so we're not going to use this option. What we do want to do is create a new repository. So let's go ahead and create a new file here. We're going to walk through a few steps that might not make sense. You at first, but down the road, they're going to. And before we do that, let's also switch it from https to S S H. Now again, if you don't have your assets H key set up. That's fine. You can just use https. I have ssh set up. So I'm going to use this link now before I do that. Actually, what I'm going to do is create a little temporary director here, so I'm gonna make a new directory and call it test, and I'm going to see d into this directory. And if I do PWD we can see him in a folder called Test Years. We're going to look different. Years will probably have a user name. Or if you're in windows, that will say, See, Dr Windows Yada, yada yada. I'm just in a new folder. There's nothing in here. I'm gonna pace that first command. And if I do ls Dash L. A. We now have a new read me filing here. We also need to in it or initialize a new git repository. So we do Get in it ls Dash L. A. And we can see we now have a get folder in here. We pretty much never need to access this. Get folder. Now, we're going to do a quick little commit. Just follow these commands. I'm gonna walk through all of this step by step lesson by lesson. So we're going to get a get add the Read me If I do it, get status. You can actually see there's a new filing here again. You don't need to know what all this is. I'm going to create a new get commit. This one just going to be called first commit. If I do get log again, we'll explain. Get logged more in depth down the road. We can see I've got a hash in here, which is pretty cool. I've got head Master, I've gone author. This is this is where we configured our account using get config dash, dash Global. That's the user input in. This is the email address I put in. I just and I just blurt out my email address there, but it'll say your email address. Next. We need to copy this line in here. Get remote, add origin paste that in there. And if we could do get remote dash V And again. Don't worry, We're going to get into all of this a little bit later. You can see that I'm using Ssh! Get at get hub dot com instead of https. So I'm using Ssh! And this is my get user name. Get hub user name. And this is my git repository. And lastly, we just need to push. Let's do get push Dash, you origin master again. We're going to go over all of this. We just need to get through these commands initially. Now, this is the first time I'm using using this new ssh key. So it's after me asking me if I want to continue. I'm just going to type. Yes, If you don't have an ssh key, it's going to ask you for your user name and your password. To get hub, you're going to need to enter those every single time you want to do a push. I have an ssh key, so I don't need to do that every single time. Now, let's go back here and I'm simply just going to refresh this page. Hey, look at that. We now have push our first file up to get hub. Now, we don't necessarily know what all those commands were, and that's okay again. I know I've said this 30 times already, but we will get into each of those commands at this point. You should have an example. Get Hub Repository set up with one filing here called Read Me. And if we go and edit this, how we can actually see that just says get essentials. That's exactly what was in that original command when we created this new file, and all we did was say, Hey, we've got code on our computer And then we basically zipped it up, sent it over to get hub get Hub said Cool. Yeah, I can accept you. You are who you are because you own Ssh key or you typed in your user name and password, and I'm going to apply these changes now. There's a lot of different things in get help. We'll get into a lot of these different things. The more common things, at least, but for now, you have a brand new repository. 10. How to push to your GitHub repository: We now have a brand new repository on Get hub and let's say we want to add some more files now. When we created this repository, we actually create a new file called Read me dot MD and push that up. Now. Pushing is the term that we use to basically get code from our computer off of our computer and on to get Hub. That's called a push, and really, there's four steps to this. So whenever we create a new file or we edit an existing file, we have something called unstaged work, and then we need to stage our files or stage our work. Then we need to commit our work, and then we need to push our work to the repository. So if I do P W D L A Stash L. A. You can see him in my test folder, And this is where that test read me file was when we first created this new repository. Now we created that file by saying echo a bunch of stuff in here, and then we forced it into some file dot txt. That's basically all we did there. Bananas go hadn't actually create a brand new file something that we're going to want to really work with. So I'm going to stay in my command line, and I'm going to be using a program called Vim. You can use Nano or vie or anything else you like, or if you want to, you can get totally out of this and you can use V s code sublime. Adam, whatever text editor you like to use for writing your regular code for me, I'm going to create a new file using them just so I can stay in my terminal. I'm gonna call it first dash push dot txt Now in here, I'm simply going to right. This is the first push and right and quit. Now, if you don't know them, I'm not going to teach you them. It's it's pretty hard core foreign editor. You could just as easily use Nano, and it's pretty much the exact same thing. We'll talk a little bit more about these as as we progress through the course as well. So now if I do ls Dash l. A. I have a new filing here called first push dot txt And if I do get status and this is a command that you're going to want to run over and over and over again. You're actually going to want to run, get status so often that it just becomes habit. When your brain forgets what you're doing, you just automatically type get status. Now when Here we have untracked files. This is a brand new file called first push dot txt. Now this is technically unstaged. What that means is, even if we did a get push origin master like we saw a couple of videos ago or that last video, nothing's going to happen. We're not telling gets to actually add this file to our little package and then ship it off to get hub. So it's not actually doing anything. We need to actually add this file. So get ad and then I'll just type first and then hit tab to auto. Complete that. Get ad first push dot txt. Now it'll look like nothing happens. But if I get status again, you can actually see that the file is now in green. Issa's new file changes to be committed. This is now staged. What the file in green means air with the lining green means is when we create a new commit or think of it like this, when we create a new package, we're going to open up a new box. We're gonna put this file in and we're gonna close that box. I'm gonna write who is going to and who put the file inside the box. So the author, that's what a commit is. So at this point, we have this file It's staged, is ready to go into a box. It's ready to be committed. So we do get commit Dash M for a message. I want to say this is the first official push. Technically, it's not because we pushed once already, but this is a more in depth look at it. So I'm going to say that this is the first official push. Now, if I go over to get hub and I just refresh this, we're going to see that nothing has happened. My files not in there yet. And that's actually for a good reason. We've only created the committee. We haven't actually sent this box or told FedEx or UPS to pick up this box and send it to get hub. We now need to do that we need to call the delivery company and say, Hey, come pick up our box. We need this to go to get hub, and we do that with get push origin Master, now what this means, actually, what I'm gonna do here is clear this. Get push origin Master, put the in the middle of the screen. So get is our main Get command pushes what we're doing. We're gonna say hey, take our current commits and push them to wherever our origin is. How our origin is Get hub. That's what this is. This is our origin. Your origin might be get lab if you using Get lab or it might be bit bucket or self host to get lab. It could be anything but in terms of git, we just call in origin and it takes care of where it's supposed to go on and how to track it and things like that and then master is our branch. Now, in get hub, we tend to work off of a primary branch called Master. It's like when you serve an HTML website and your browser automatically looks for index dot html Well in get it's automatically looking for a branch called Master. We look here, we can see we only have one branch called Master. It's the default one. Now, technically, you can change that. But by default, it's always master. And so we want to say in this branch, and we'll talk more about branches down the line. But in this branch, we want to add our box of files. So we simply say, Take our box of files. Hey, get to take her box of files, push it or, you know, package it up, deliver it to get hub and put it in the master branch or on the master shelf. If it was, a giant warehouse would be putting it on the master shelf. So I hit. Enter, get push origin Master. Now, if you don't have an ssh key working, this is going to ask you for your user name and your password over and over and over again . You'll just keep asking you every time we want to do this. And that's why I really suggest you get in operating. Ssh key. No, this is all good to go. It's using Delta compression up to three threads. It's compressing. Are objects to order to We're done. There's a bunch of magic behind the scenes and now it is saying we have a new get committed from our current master branch to the Origin Master Branch and let's go take a look at this . That's refresher page now, and we'll see a second file get pushed out. Txt and I can click it and it says This is the first push. Now where did commits really come in? While we'll talk about Kim, it's down the line, but to see a commit is really just looking through the history of your code. So this is our first commit. I made this 29 minutes ago and the first official push, which is technically wrong because you can see that there's two commits in here. So one of this was obviously the first push. But the first official push, this is what our commit message was was made three minutes ago. Now we can browse the repository at this point in history. So if I click this, this essentially just went back in time before the the new first push dot txt file even existed. So this is almost like we're actually looking at the code from 30 minutes ago. And if I click this well, this is just going to look exactly like where we're currently at. We're currently at Master now you can see it actually changes the u R l up here. So let's just go back to our code and we just want to make sure we're on just the regular tree here is just a regular master and we can take a look at this file and at any point in time. So really, that's all there is to pushing. That was a quick little recap to push. You have unstaged work, then you need to stage your work. I'm gonna council that instead of complaining that it doesn't have a command called stage, so you have to stage your work. Then you have to commit your work with a commit message, and then you have to push your work to your origin master. Now remember to commit often commit small commits. The reason for that is because if I was to go in here and let's say you and I were working together and your your first commit well, this one only has one change in it. But let's say your commit has changed 170 files, which is not unheard off, but that is a rather large commit. If I'm doing any sort of code review, and I need to see what you changed, it's really hard for me to go through 170 files just to find maybe one little bug or scenario or a reference to a piece of code, whereas this is just one tiny piece of line. But if you keep them somewhere between one in 10 files, that's usually a pretty good size. And really, that's all. Just because smaller commits are easier for co workers to read through, it's also easier for you to read through down the line. 11. Git status: up until this point, we've worked with a command called Get status, so get status. And currently there's nothing in here to see. Get status is pretty much the one command you're going to want to run more than any other git command. It is probably actually the most popular command. I use every single day. Get status over and over and over again. And because it does no harm every time we take get status, it does no damage to my project. It doesn't change anything. It's just a status update, really, and all this is going to do is show you what files have been changed, deleted, added or renamed. It will also show you which files are currently staged to commit, which is super important for committing, so I tend to use get status over and over and over again. Most Dev's tend to use get status a lot. It's a good habit to be in. Always check your status, always type, get status over and over and over again. Now to show you ah, proper example because in last few lessons we sort of skipped over the whole get status thing. So as an example, what I'm going to do here is we have this first push dot txt filing here. So let's added that file Vim first pushed dot txt and set the numbers on here. And let's go down to line three and say This is the second edit to this file. No, again, you don't need to use them. You can use Nano V s code, anything you like. I'm just doing this so I can stay inside of my terminal. Now if I do get status, it's going to say that there's something different. It says that first pushed out txt was modified. Now, if you remember from last lesson, it actually said that this was a new file was an untracked file. And if we actually read through this and I always, always a read through this, I know it's not nice because it's all plain white text and sort of melts together, but definitely try to read through it your branches up to date with Origin Master. That's get hub slash Master Branch change is not staged for commit so these air unstaged changes and even tells us how to do this. It says Get ad and in the file name to update what will be committed so that staging are files. And if we ever wanted to, we could discard changes in a working directory with get check out dash as fire, and we'll talk about that later. But the one we want here is get ad first push dot Txt. No, If you wanted to add all files, let's say you have 10 files and you don't want to type out every single one you can do. Get add dot and that will add all of your currently unstaged file. So if we do get status again, we can see changes to be committed. This is ready to be committed, and now we can add get commit in your get commit second change to this file. Now, if I do get status once more, you're gonna see that nothing is in there. And that's because that's already committed. That's already in our little box that we're ready to ship out of our warehouse or code warehouse, and that's sitting on the docking bay that's waiting for FedEx or UPS or some other delivery company to come pick up this box. So, for all intents of purposes, we can now say that's done. We don't need to do without anymore. And in order to once again actually push these changes up to get how we have to do get pushed origin master, There we go. And if I go back to our repo here, just go to our code. Looks like nothing really happened. But there is 1/3 commit in there now. Second change of this file. So that's pretty important. Let's take a look at this particular commit and we can see in green here that we added this line. If we deleted this line, it would be in red, but we didn't. We added a line. So it's in green. We can also see that with our first official push commit, we had a two lines in here a blank line online too. And this is the first push on line one. Both lines are green because this it was a brand new file. So throughout this entire journey, we're going to want to be writing, get status a lot to get status. You see, there's nothing in there. And if I wanted to, I could do ls Dash l. A. And I could remove first pushed r TX CRM just means remove. I'm going to delete this file. If you're in V s code or sublime, you can just simply delete the file. Or if you're Explorer or finder, you can just delete that file as well. Now, if I do get status again, actually, let's not do get status yet. Let's do ls Dash L. A. We can see that file no longer exists in there. And if I do get status, it actually says my file was deleted. Now, in the next lesson, we're going to learn how to unstaged a file. So what happens if we accidentally stages filed to be committed and we're like, 00 no, We don't actually want to delete this file. We want to make sure that this file always exists and we accidentally added it to be committed. We're going to tackle that in the next lesson. 12. Unstaging a file: in the last lesson. We created a file and then we deleted it. And let's say this was an accident. We didn't actually want to delete this. Now let's set ourselves up for failure because this is absolutely going to happen to you down the line. This happens to be quite often, not every day, but happens to be quite often when I get a little bit sloppy. So when I do get, add and let's say I just wanted to add all my files to be committed and I do get status this file now have says it's been deleted and that's going to go out on the next commit No . What if this was a really important file? What if this was a settings file or a configuration file for my entire project? And I'm like, Oh, no, I don't want to commit this. How how do I get this to not be staged anymore? Now that's actually super super easy. We can actually see it says in here, Get reset head file. Now we can actually do this really easily. Honestly, we just have to follow the instructions that are in here. Get reset head in capital letters and in the file name. First push dot txt Unstaged changes after reset As you get status again. This this is where get status really comes in. It's super important. We could see that the file has now not been staged to commit. We unstaged it now. It hasn't been under elite ID, but it has been unstaged. So now if we were to make another commit or at other files, we don't have to worry about having this accidentally pushed into a repository. Because again, what if this was a big mistake? What if this was a settings file or a project configuration file that was really important ? We accidentally deleted it Well, with get, we could always go back in time and bring it back. But this is an easier way. We're preventing the problem from happening. First, let's go over this example just one more time. Let's do get ad first bush dot txt to get status, and we can see that it's been deleted in there Now, too unstaged is. All we have to do is get reset head and then the file name. First push dot txt get status again. It says unstaged changes after reset, and we have officially staged and unstaged a file. Now, what happens if we accidentally deleted this from our computer? Because again, that happens from time to time, we actually run a program that deletes something, or we actually delete the wrong file. How do we How do we undo this Well with get Because this is a version ing system. We can undo this delete entirely. I'll show you had to do that in the next lesson. 13. Undeleting a file: leaving off from that last lesson. We have a filing here that we've accidentally deleted, called first push dot txt. The last lesson we staged that fire and then we unstaged that file so we don't accidentally commit it. But now that say, we accidentally deleted this file for whatever reason and it doesn't really matter how or who did it, but we we need to undo this delete now, without get most of your files will end up in your computers trash folder Or, if you do from the command line and you do RM first, push don t Xia. Now I've already done this a couple of videos ago. That's why the files deleted. But this might not be in your trash, so it's technically gone forever. The nice thing about get is we can actually bring this back. All we have to do is type get check out, and it actually tells us up here that we can do get check out dash dash file to discard changes working in our directory so we can do get check out dash dash, first push dot txt and get status. Look at that. Now, if I do ls dash L. A. My file exists again so I can do this once more. As as a faster example. We can do RM first, pushed out txt, get status and says I've deleted the file, but I want to undo that. I do ls Dash l. A. We can see the file no longer exists and with get check out dash dash And then the file name that was deleted pushed out. Txt get status. It's no longer in there. It's not ready to be staged. It's not currently onstage. There's currently no changes. If I do ls Dash L. A. It brought my file back from the dead. Now, that is how we bring a file back using get check out, get check. It was also used for other things. We're going to explore that option a little bit down the road as well. But if you ever accidentally delete a file, if you're using git and you have a previously saved version of that file in a commit, then all it's going to do is bring it back from that last commit. So when we said get check out dash dash, first push dot txt All it's saying was pay on file. I know you've got three commits That last commit was this one here and this was the contents. This is what was inside that file. So I know that because I have that in my history, I'm get I'm the all knowing, all knowing file, master. And so because you already have this, I'm just going to give you whatever you had before. And so that's what get did get said Hey, you wanted to bring that file back. I've got a copy of that from your last commit and now you're able to revive files from the dead using Get. Now, I use this even if I don't have a git repository set up on get hub, get lab orbit bucket. I use this even when I'm just testing things out on a local project or I just want to try to break some code. And, you know, I want to be able to undo a bunch of work. I will simply set up, get in a repository on my computer by typing get in it, and that will set up a new get repository for me, and then I can do to get ad I can do, get, commit, get check out. I can do all that stuff, and it does not necessarily have to go up to get hub, get lab or bit bucket. So that was your little crash course on the get check out feature that we have available to us again. Check out can be used for something else. We'll talk about that down the road, but let's start diving into something that's a little less file based and a little more get based. 14. Git origins and remotes: let's talk a little bit more about an origin. An origin is really where your remote code is going to live. Now, if I did get in it and I did not connect this to get hub, then currently there is no remote origin. Now we can actually see all the origins here by doing get remote Dash V. And we can see we've got an origin in here for fetching and pushing. Data fetching is when we try to download updates and maybe apply those updates to our computer. And pushing is where we're going to push our files from our computer to, let's say, get up now in this origin it says that we're using get Atget hub dot com So we know because it's get at that. It's using Ssh! If you're not using, ssh is going to say https, get hub dot com slash Caleb Julian slash get dash essentials Don't get something like that . So this is our origin. And really all that means is we have some distributed place toe host our coat. No, it doesn't not necessarily need to be get hub. It can be Get lab. It could be a bit bucket it could be some other service. It does not necessarily need to be get hub now. It just happens to be that we're using get, huh? Because get hub is the brand name. Now the good thing behind having an origin or behind having remotely hosted code Or in this case, distributed code is there is an official copy of your code somewhere else other than your computer. Now, the good thing behind that is servers can access this. If your computer work to die today and you bought a new laptop, your laptop could access this and you would not lose any of your work. If you wanted to share this project with a friend who might contributes to this repository as well, you could share this link and they could clone it using ssh or https and they would have access to this coat. So instead of them downloading directly from you, they download from a distributed system such as get hub, get lab orbit bucket. Now, in our case, our origin is always going to be get, huh? Because that's what we're we're working with here. If we had said we don't want to use get up we want to use get lab orbit Bucket. Then this you are all here is going to change is not going to get hub dot com. It'll say Get lab dot com Well, regardless, when we type a command, get pushed origin Master, get push origin Master, this origin is always referring to here. Now, technically, we can have other origins and they don't need to be called origin either. It just happens to be that by default is called origin. If we wanted to, we could add another remote. We could add another repository to push, too. So we could if we had added another repository to add to which we're not going to, because I think that gets a little too confusing at the at the beginning. But if we had another one that said not origin, maybe it's called production. We have a different repository for our production code. We do get push production and then the branch name, which in our case, is going to be master. But it might be a different branch name feature Branch name something like that. And now we've swapped out origin for whatever else might be available to us now again. We're not going to add a new origin. I just wanted to show you what origin is because we're going to be typing. Get push origin, master or get pushed Origin branch name quite a bit down the line. And so we just want to make sure that we are all on the same page when it comes to all four of these, when it comes to what get is what pushing is what the origin is and what your branch name is. 15. Git branching: Let's talk about branching. So so far we have typed this one command a few times. Get pushed, Origin Master. So get push all over commits that we have currently on our computer, pushed them all over to origin, which happens to be get hub and into the master branch. And if we go over to a repository, we have different branches in here. Well, technically, we have only got the one branch, but we can add more branches now. A branch is really just a copy of the original work, but when you make changes to the code, it doesn't copy all of the changes. It really just stores the differences and applies it or compares it rather to whoever the original branches coming from. So let's say I have this code in here and let's say you also have this code. But you made a change to this file called First Push and you change this to B something completely different. Well, we can do this in one of two ways we can work right off of our master branch. But if I'm also working in that file, well, get doesn't know who is going to be right who is going to be wrong. So we're going to have some sort of code conflict there should get trust my code over your code. Should it overwrite your code with my code or vice versa. It doesn't know that the second way is we can create a new branch and to create a new branch is actually super easy. So if I clear that I could do get check out Dash B that stands for Branch, and I'm just create a new branch called New Branch because I'm not going to be creative with my branch name. It says I switched to a new branch and if I do get branch, I can see now I have a master branch that lines up with here, and I've got a new branch now. The thing with this is this is all just local because I haven't done a dit push command yet . There are no other branches in our origin. It doesn't know about it yet. Now I could try to do a commit in this new branch, but unfortunately, when I do get status, it says there's nothing in here now. This is going to be a very quick lesson on get branches because in the next few lessons we're going to work more with it. So this is more of an introduction. Now we have two branches and say We've got one called master when it's not, say we do, we have one called Master and we have one called New Branch. If I do get branch, you can see that I'm currently on New Branch. It's highlighted. Its got asterisk beside it. I can also tape get I'm gonna move that down a little bit. It also type get check out, Master. And if I typed, get branch again. I've moved to master I could do get check out new branch And if I do get status, there's nothing in there. And if I do get branch it also says I mean the new branch. Now again, at this point, nothing is going to happen. You're not going to see any changes because we haven't made any changes. But in the next lesson, we're going to make a new change. We're gonna add a new file to this new branch and it's not going to touch the master branch at all now. One way to think about This is like a tree, like a literal, tria physical tree. Master is the tree trunk. So think about this big, big tree trunk and all your branches are just these tiny little tree trunks and it just has a little bit of coding. And so all you're saying is I'm gonna go from master and check out a new branch or create a new branch and check it out right? A little bit of code. And the idea is to then incorporate that little bit of code back inside of master. So you're not supposed to create a branch and make these massive, massive changes supposed to create a little branch and merge it into master as often as possible. And every time you create a branch with little code and you merge it into master, we'll talk about merging in, uh, couple of lessons, I believe. But every time you merge some code in from one of your branches into your master branch, your master code base is going to get significantly bigger and bigger and bigger, or you've made some changes. You've edited a file and that's going to change its going toe change. Your master code base over time. The nice thing about that is you always have your commit history to always look back on. So let's go ahead and move straight into that next lesson where we're going to commit to a new branch. We're going to actually make sure that that new branch shows up in here. 16. Committing to a new branch: in the previous lesson, we created a new branch. So if we do get branch, we can see that we have two new branches in here. If you skip that previous lesson, all we did was get check out Dash B and then the branch name. So new branches. What? I call this one now. This is not going to work because his branch already exists. It says fatal branch named New Branch already exist, so I can't do that. But we could create another branch named anything else? I'm not going to do that cause we already have a branch. Now, if I wanted to go back to Master, I could go get check out Master, get branch, get check out new branch, get branch, and you can see that we've changed from master. And then we switched over to New branch. And that's where we're going to be working for in this video is our new branch. So if you're following along with me, you need to make sure that you have a new branch in here. So let's go ahead and create a new file for this new branch. So I'm gonna create a new file called new branch file and this is just going to be super boring. There's nothing Nothing fancy in here. And this is new branch file. Onley shows up in the new branch. If I do ls Dash l. A. We can see we've got new branch filing. If I do get status, we have a new file in there. So now we have to stage the file, commit the file, push the commit so get status. Get ad new branch file, commit new branch file. If I do get status again, there's nothing in there. That's good. I could do get push origin Master. But master is not the branch that we're pushing to anymore. That was the branch we were working on up until this point But now we're on a new branch So our origin has not changed. Our origin is still get up. But we want to change our branch. Our branch is says on Branch New Dash Branch. So we do new dash branch now just for fun Z's Let's go ahead and see what happens when we push to master get push origin Master Even though we're on the wrong branch but says everything's up to date. Technically, it's not. We have a commit. We made a new commit in here and there has to be some sort of change. So if you ever see everything is up to date and you're like, Well, why is my code not being pushed to get hub? This is why is probably trying to push to the wrong French. So let's do get push origin New branch. And there we go. That's been added. And if I come back here, yeah, you can see there's a pull request. So I am now in my master branch on get hub and you can't see my file in there. But you can see that Get Hub did in fact, accept my new code in the branch called New Branch. So if I look at my branch now, I have a second option called New Branch. And in here I have a file called New Branch File. Now, this did not exist on Master New Branch Fi only shows up in the new branch. That's actually correct. If we switch back over to master, that file doesn't exist in master. So it's going to give us a 404 a missing page now, just once more. The new branch file doesn't exist unless we go to that new branch. Now, what's really nice about this is if you're working with a code base that you know for certain is pretty much perfect. And you just want to sort of branch off of that work and, you know, test a few things or write some new code. This is where you would use branching. And so when I go into my new branch, I added a new file and I could do anything I want. And this will never, ever touch the master branch until I either make a pull request or purposely merges back into master. Now, in the next lesson, we're going to merges into master using the command line. And that will mean that our new branch file is going to show up in our master branch. We're going to make that happen. At this point, I would like you to take a screenshot of your branches in your Rebo in here, not my repeal. You should not be working off of Caleb Williams slash Get essentials. You should have your own repository. I want you to open this up and take a screenshot over this new branch. And then I want you to share that screenshot in your skill share project. And it should look exactly like what you're seeing on my screen Here. There's a master branch and a new branch. Whatever you decide to name that new branch. 17. Merging a branch into master: murdering is the act of taking one branch and applying it to another branch. So in her previous lesson, if you're just tuning in now, we created a second branch called New Branch. And it has a file called New Branch Filed a txt and that does not exist in the master branch. It only exists in its own branch Now, what if we said hey, new branches done. The work that we were supposed to do is done, and we now want to actually merge this into the master branch so everyone gets to use it. Well, in this video, we're going to take this branch and we're going to add this file to the master branch so that when we are looking at our master branch here, we will see the new file so really emerges. Just taking one branch and merging it, literally merging it into another ranch. So for this, we need to make sure that we're on the right branch. So get branch will show us all of our branches. Get check out, Master. And if we do get branch again, this just confirms that we're now on our master branch and what we want to do is we want to merge new branch into master now, before doing this, always, always, Always make sure you're up to date with your target branch. So my target branches Master, I want to pull new work into my master branch. Master Branches Now my target branch. So I can do that with get pull origin Master, I'm on the master branch on that matches here. So this is going to look for new changes. That's un get hub. That's the origin and in the master branch and it's going to apply those changes on top of my code. Now I'm going to run this. Nothing's going to happen. Says I'm already up to date because get hub already has everything that I have and I have everything get up has in the master branch. But it's always a good idea to always update your target branch first. Otherwise, you could get into some pretty nasty code conflicts that you're going to have to resolve. And if you have to change 100 files, that's gonna be very, very painful. So always do we get pull origin, Master, before you do emerge. Now I'm going to run this with yet emerge. That's the command. And I'm going to merge in the branch that I wanted to be added to my current branch. Now that might not have made sense if I do get Branch. My current branch is master and I want to merge in New Branch into master. So get already knows I'm on master and it's going to say, Hey, I'm going to try to merge New Branch into master. It says it fast forwarded. There's new Branch filed a txt. One file changed one insertion created new with new branch file in it. So if I do get status, there's nothing in there. If I do ls Dash L. A. I can see my new branch file is now in there. And if I do get Branch, I'm still on Master. Now here's the thing. Just because we merged it locally does not mean get Hub is aware of this. You can see I'm still on my master branch and it still doesn't have that file in there. So now that we've merged this in, we have to get push origin again. Let's get hub and push it to her master branch. So what? We did there was. We took the code from New Branch and merged into a master branch, but only on our computer. That whole thing happened on her computer and get up doesn't know about it with get Push origin, Master. What it said was okay. I now know that there are changes on this computer and get hub now needs to know about them . So when I refresh this page, we'll see new branch file dot txt And when we click into it, it says new branch file only shows up in the new branch. Technically, that content is wrong because it now shows up in master and we can edit that if we wanted to. Now this point. Please take a screenshot of your commit history and update your project with this image. So when you're in your get repo, go ahead and click That commits text. Mind says four commits Take a screenshot of this page on your repo and share that in your skill share project. 18. Seeing your Git history: When we're looking through our git repository, we can look through our commits here, and we can see all these different commence now. We can also do this on the command line quite easily, and this is actually going to come in really, really useful a little bit down the line. But this command that we're going to use cold, get log and get log, and this allows you to see the latest changes in a branch quite easily. And it'll show you the person who made the command to commit hash and commit message in date. So if I do get log, you could actually see that I've made all the commits. If there were other people making commits in this branch, then you would see their name in there. In here we have a commit hash. That's our unique hash that identifies every commit. So it's always different. We have our author. That's my name. That's my get config user dot name. That's what we added. Long, long, long time ago. We have my email address in here that's going to look like your email address. I have that blurred out just for privacy reasons, and then we've got our commit message. Now I use git log quite often to compare work from my branches to what remote has This allows me to see if what I have on my computer is the exact same as what is on Get hub. If I have the latest commits, then great. But if I don't, I might want to do a get pull origin master. So what I can do here is I can just simply say Hey, the latest commits on my computer is called New Branch file. And if I just open up this repose, If I had never gone to the commits in the first place, click on four commits and you can see my latest commit is a new branch file. So I most likely have the exact same code or at least the updated code that get Hub is aware of. Now, if that was not the case, if we're whatever reason, you a different code, you could do get pull origin Master, assuming you're on the master branch and it would update your branch for you. But we'll talk about pull a little bit more in the next lesson. Now, one other thing is you might want to move up and down. Now I only fit so much text on my screen because I've made this quite a bit bigger than what I usually use. But I can have either page down or the down arrow or the letter J so Jay will move me down . K will move me up, down, arrow down, up, arrow up. And depending on your current configuration with your terminal, you might be able to use page up and page down as well. And to simply get out of this, you just hit the letter Q. For quit. 19. Downloading updates from GitHub: from time to time, we have seen me Type this command, get pull Origin, Master. And I keep saying, you know, if there are changes on get hub that you don't have just take this command and you'll get them. And that only really applies for your current branch. So if it was a different branch, you type get pull origin and then your new branch if you're currently on that branch. But let's explore how this pool actually works a little bit more. So first things first. I know that there are no changes in my rebo in my master branch, so I'm gonna do a get pull origin Master. We're going to see that it says already up to date. Now, let's do this as if someone else were editing this code so on Get hub. Let's go in. Edits our read me file. I'm gonna click this little icon here and I can edit this directly on get hub. Now this read me file is taking a syntax called markdown so I could add deployment notes. I could add staging notes. I get ad how to use this repo notes, anything like that and just for funds these. We'll put some Lauren Ipsum in both of these and let's split these out. Now. If you're not familiar with Mark down, I would suggest taking a look at Mark down because get hub, get lab and pretty much any sort of report. There really relies on Mark down quite a bit for the Read Me files. Let's go ahead and preview our changes. And so we've got an each to have an H one. We've got some regular text in there. The green means that that's what we've added. Let's go ahead and commit these changes right on. Get hub. This means that our local computer is not going to have these changes. Something to say, updated, read me dot MD marked down and an optional extended description. Not gonna put that in there, but you can if you want, and it's gonna ask me if I want to commit directly into the master branch or if I want to create a new branch for this, commit and start a pull request. Well, I want to go straight into the Master branch just for this demonstration anyways, so let's commit these changes, and if I go back here we can see that my read me file has now been updated. And there's a commit in here called Updated. Read me dot MD is now five commits There used to be four and this is now in my commit list and we can see all the changes that I made in here. So I have this new commit and on my computer if I do get log, my latest commit is new branch file. I'm one commit behind now. So now what I can dio is I can immediately pull down the latest changes I can do. Get pull origin, Master. And what this is going to Dio is going to take this commit and it's going to download it right onto my computer. So if before I run that I run cat, read me, you can see there's only one line in here just to get essential stuff. I'm gonna get pull origin Master. In fact, I'm not even going to do that yet. I'm gonna first check out my branch. Would I want to make sure I'm on my master branch. So I am on my master branch. Get pulled Origin Master, and you can see that it's doing a bunch of stuff. It unpacks the objects fast, forwarded me, read me. There's some changes in their nine insertions. And again, if I do do Cat read me dot MD, we can see that's not just one line anymore. It's a bunch of lines, and if I do get log, you can see that the latest one in here is updated. The remain dot MD file. Now, at any point in time, if you are trying to push your work to get hub or get lab orbit bucket or any sort of repository, and it's saying that it has work that you do not have, you will not be able to do a get push origin master. So let's set this up as an example as well. Let's go and edit one other file a new branch file and let's edit this. We're going to call this new branch file only shows up in New Branch that's a new branch file shows up in Master and a new branch. That's what is going to say. This is the new text that this file is going to have, and we're going to say update new branch file dot txt and we're gonna commit that directly to master. So no, If I go into my code, I can see all my commits. I've got six commits in there now update new branch file dot txt But if I get log, I don't have that. I've only got updated. Read me dot MD. That's the latest one I have. So I'm technically one commits behind. Now let's go ahead. Run, get status. Nothing's changed. Ls Dash L. A and I. Let's add one new file. So I'm going to create a new file just by touching. It's going to be empty file, and it's just going to be literally called empty file dot txt ls Dash L. A. You can see my new file is in there. There's nothing in it. Get status. Get add my empty file, get status, get commit, added a new empty file, and I actually type of that. So I canceled that. There we go added new empty find. If I do get log added, new empty file is in Their updated read me is in there, but I don't have updated new branch for hell dot txt. So now there's some sort of issue the work that I have and the work that get Hub has its different. And if I do get push origin master, you're going to see an air that looks exactly like this field to push some refs. So some references. Basically, if you just read through this, it will tell you exactly what to do. Get is very helpful that way. But it's saying our updates were rejected because the remote contains work that you do not have so remote is our origin. That's get hub. It's saying that they have work that we don't have in our computer, and this is usually caused by another repository pushing in this case. That's because we made changes on here, but we didn't bring those changes onto our computer. So our local version of Get doesn't know what to do and same with get up, Get up is like, Oh, well, there's work that you guys have, But I also have some work. So what do I do? And this is the beginning of a conflict, and we need to sort of resolve this conflict a little bit. Now, it says, you may want to first integrate the remote changes. Example using Get pull origin, master. And you can always you get pushed. Ash, ash help to see more notes about fast forwarding. So let's do this. Get pull Origin Master. And now it's asking me to merge some work. Now what we're doing here is we're saying, Hey, get about some work on Branch Master. I have some work on Branch Master. We need to merge these two things together. And so in here we can just write a new message. I usually just leave us as default, but you can write a new message in here. And for this I'm using Nano. So I want to hit control. Oh, and that will just save my file. Don't rename your file, though. Just hit, enter and then control X to exit. And that will continue. Now if we do get log, I have my merge. That's from get hub itself of gods. My new file and I have the file that was from get hub. So it applied my work on top of get hubs work And then there was a merge Commit on top of that. Now that gets a little bit confusing. I know that, but if we do get pushed Origin Master because we have a new commit from that merge that get Hub didn't know about this is now Okay, I have all the work from Get hub. I have all the work from me It's been merged together successfully and now we can push all of that to get help and get Hubble. Say I understand exactly what you're trying to do. So if I simply refresh, we can see that I have my new filing here. That's my commit and the merge commit. And if I go back to the master branch, check out my empty file. There's nothing in there. That's my empty file. And so if you ever run into that problem where get home or get Labra bit bucket is like, Hey, we've got work, but you don't have it. This is what you do. You get pull origin, master, save that commit message and then you can get pushed Origin Master No, this is assuming there are no code conflicts at all. That means this is assuming two people did not edit the exact same code in the exact same line in the exact same file. If that were to happen. That's a whole different process, not a whole different process. It's a very similar process, but it is a little bit different. But then you would resolve those as well, which we're not going to get into in this video. Make your commit message and then get push origin master and everything will sink up once again. Now, one thing to pay attention to here is when we do get log and I should have covered this in the get log lesson. To be honest, we have our commit. But we also have this thing called head. This is where you get program thinks you currently are. It says your head is that master. And if we were to go back in time to any of these other commits, that head would change. Now that is a very simplified version of that explanation. But essentially, how that works is head is where get thinks we currently are, and we're currently pointed at our master branch. So if you ever see that, that's what that means. It just means that because get is somewhat of, ah, time machine, that we're currently exactly where we're supposed to be. And that's exactly where master is, that also gets a little bit confusing, and I cover that a little bit down the road as well. 20. How to get updates from GitHub: in the last lesson we learned more about get pull, get pull, origin, master and sort of what to do. If the code on Get Hub is different from the code on our computer now, what did poll technically does? Is it downloads all of our code or all of the code, rather from get hub stores it in memory per, say, sort of as a way of thinking about it stores it in your computer's memory rights. All the commits to your local version of Get on Your Computer and then it skips right to the very top. Now what happens if get up had some work that we didn't have, but we didn't necessarily want their work. We wanted to see what was in their work. So let's go ahead and change empty file. We're going to rename this to a not empty file, and this is not an empty file. Let's actually change that from a txt file to a markdown file and preview our changes. This is not empty. File out. Let's throw some Lauren ipsum in there. Preview those strangers. Okay, this is not empty file. Have some warm. If some text updated, Updated the empty file to not be empty anymore. And this is just my commit message and I'm going to commit this directly to master, and I'm just setting us up for an example here. So now when I go back to my master branch and I click on commits, we're going to see that Get Hub has this particular commit that I don't have on my computer because you can think of it as someone else writing this code, and I just don't have it on my computer yet. So if I do get log, you can see my latest commit is merch Master Branch of Get hub dot com blah, blah, blah. That's this one down here, But I don't have this code now. Let's see. I don't necessarily want to download that code and apply it. Maybe I just want to see what's available out there. I could do get fetch origin, Master. What this will do is it will download all the codes still and put it on my computer, but it will not apply the code. So what I mean by that before I run this command is If I do, maybe let's not do that. Let's just look at this. We have a filing year called Empty File, but on get hub, we change that. To be called Not empty file, not empty file dot MD Let's say we still want to work with empty file, but we just want to see what changes air out there. We could do get fetch Origin, Master. And what this will do is it will download the fact that there is this commit out here that this commit does exist, but it's not going to apply it to our code yet. So that downloaded the latest code. And if I do ls Dash L. A. Once more you can see this has not changed. I still have my current coat. And if I do get log, I can't actually see anything else. But I do technically have access to that. Commit. Now I'm gonna give you a sneak peek into a cool command that I like to use called Get lg. And this shows me the entire tree. So if I make that a little smaller here, we can see that my head is that Master, which is current Merge Branch Master and the Origin Master. Where get hub is, and the master branch on Get Hub is is currently out of commit called updated, the empty file not to be empty anymore. So technically they're one step ahead and you can actually see that they're commit is literally higher than are committed one step ahead. Now that's cool, because we can actually see that there that there is a change, but we just have not applied it yet. So if we do ls Dash L. A. We can see that we have the empty file in here. And if we wanted to, we could now get pull Origin Master, and this is going to fast forward us exactly to where get Hub is currently. So this didn't need to download anything this just fast forwarded us. That's what fast forward is. So if I type g o g again, Ngog is, ah, custom command that I have it stands for Get LG. It's just a nicer version of Get log, and if you want that you can also just Google that it's available. It's an open source command that you can add, but that's not the point of this lesson. The point of this lesson is we used to be here and now we're here. We can see that are get head is pointing to master. That's where Master is. It used to be down here and origin Master is up here. Where was the whole time? And all we did was we bumped up our program from this line where it used to be. And it is now with this line. So I do ls Dash l. A. Once more we can see that we don't have an empty file anymore and we have not empty file. So if we cat not empty file dot MD we can actually see that there is now that code in there That's the code or that's the text rather that I added from get hub dot com So really get fetch is a lot like a get pull origin master. But really the differences get pull Origin master is pretty much the exact same as get fetch origin, master and running Get Emerge Origin Master. So it's really two commands in one get fetch is simply just going to download the latest updates. But it's not going to apply them for you occasionally. This does actually come in handy. You just want to see what changes are out there, just in case there's something down the road that you might need to address right now. 21. Checkout: code-time travel: Let's check out one of the really cool features behind Get get, allows us to look through our history, our code history and travel through time like almost literally travel through code time. And so we've been using this command called Get Log and it gives us this nice little hash. We can also see these hashes on Get Hub. When we go into our commit history, check out her commits and we can see this little idea here. That's just the beginning of the commit hash I. D. So we're currently on updated the empty file not to be empty anymore, and that's this one here. Now let's say for whatever reason, we actually want to go way back in time, and we wanted to see what the repo initially started with while we could just click this button. This is an easier way of doing it. But if we wanted to do this straight from the command line, and sometimes there's a good reason to do this straight from the command line is we just want to copy this hash I D. And we're going to run a check out, get check out, and instead of master, which is a branch or new branch, which is a branch that we created at one point in time we could check out literally the hash I d. And so that just copied it to my clipboard. And I'm just gonna paste this now. It says no time checking out this pash. I am in a detached head state. I can look around. I could make experimental changes and commit them. And I can discard any commits that I make without this impacting any of the branches by performing enough another check out, which is pretty cool. So basically, I've went back in time and I can check out anything I want. I can I can tinker around and see what is going on. Now if I do ls Dash L. A. I only have one file in there. That's the read Me file. And this is exactly what our repo started with when we started this whole course. This was the only thing that we had in our repository. And if I do get log, it currently thinks that there's nothing else there for me. Or at least it's only going to show me that there's nothing else there for me and it says My head is at this current commit, but it's not pointing at master anymore. It's not pointing at a branch, and that means I'm in a detached head state. So if I wanted to make changes and push them to the latest get code, So if I wanted to basically redo all of this report, get rid of all this stuff I can't not in a detached state. Not like this anyways. But what I can do is I can look around and say, Hey, there was that Read me file Let's let's travel further in time and let's go to the new Branch Farms and a copy this and get check out okay and I could do against status is not gonna show me anything except that my head is detached. Which, by the way, if you ever see that, careful not to do too much work, because it might not save the way that you think it's going to save now if I do a last dash , L. A. I could see that I've got some new files in here. That's cool. So I'm sort of going forward in time. I can see what was added to this particular commit and I could keep doing that. I could go pretty much anywhere that's in the master branch. If, for whatever reason you were on the new branch, you have to check out your new branch. You do you would do, did you do to do get check out new brands you would originally have done that. I'm not going to do that. So I just canceled and then you could check out any of these hashes Now when I do get status, The interesting thing is this does say that my head is detached and that's not necessarily a good thing, because if I made any changes, that's going to be really hard for me to get back to where master is and for me to reattach my head or think about it like this for the head of the program to think that it's back toe our current time right here and now in the present, we need to get check out an actual branch name. So if I get check out Master ls Dash L. A. There's all my work I can to get log and you can see up here head is now pointing to master . It's also the exact same place where my computer thinks Origin Master is. Now let's go back to another point in time and let's create a new branch. From there, we can Let's go back to master. And it did. It did. Ah. What is in this? Commit two files. Read me and first push dot txt. Okay, let's go ahead and copy this hash. We're going to check out that particular commit, and what I can do from here is Aiken Branch off of this. Commit into a new branch, and it will only have these files. It won't have any of the other files. So let's go ahead and do get check out Dash B for a branch. We're gonna call this a time warp branch. And let's just touch a new file called time warp dot txt. Why do we get status? I can see if a new file called Time warp get Adam and at all files, get commits this file with a new message. I'll just call this time warp time work. Get push origin. Now when you learn and get your fingers were going to want to type, get Bush origin Master all the time. It's actually not right. We're on the time warp branch. So time warp, Dash branch. All right, let's go back to our main repository here and under branches. We have a new branch, We've got new branch and we have a time warp branch. If I go into the time war branch, you're actually going to see that we only have the three files we've got to read me and the first push, That's what we had when we originally checked out this commit. So we didn't have all the other work that we've done. We've only had read me and first push dot txt. And then we added a new file called time warp dot txt and we just touched it, meaning that there's nothing in there. We simply made it exist. Accidentally click that link. So let's go back. And if I type get log in here, you can actually see that my head is now at a proper branches, not detached anymore Origin time. Where branches at the exact same place I'm at and the commit message was time warp. And if I do get branch, you can see that there's different branches. Now, why on earth would you ever, ever use this? Well, when you're looking at another person's project, maybe you want to go back in time Because maybe they made a change that you don't necessarily agree with. Maybe in my master branch, I made a change to call this not empty file dot MD And you disagreed with that. Well, you could go back in time to a commit before I made this change, make a new branch off of that and then completely work off of there. And this way you don't have any of that work in there, So really have gone back in time. You said, You know what? All the stuff from whatever this commit was to right now just ditch it. You don't want any of that. That is a really good thing that you can do with check out now personally, as someone who uses get every single day, I really don't use it like that. I use it toe poke around a little bit to see different versions of things. So, for example, Weg tells a python based CMS, and we have lots of different branches in here, and I actually click that one. That's not at all what I wanted to dio. We have lots of different branches in here, and we're currently on version 2.8. But let's say we added a bunch of code in here and I didn't really like the direction that wait till was going. I could say, Hey, 2.5 was the last good release. I could check out this commit, make a new branch off of it and work off of this entirely just on my own computer. Or I could just check out this commit and on my computer. I could look through all this code in my editor, and it would undo all the work from version 2.67 and eight, and it would just show me version 2.5 work. And I actually use that almost every single day. That's actually a lot more important. I also check through get hub as well, just because sometimes is a little faster for me to just click through, get help and be like, Oh, what version do I need first in 2.0 point X? Let's go take a look at this source code now to finish this up. Let's go ahead and merges. Let's get check out Master, get merge Time warp Dash Branch It's going to ask me if I want to merge Branch time where? I'm gonna say Yep. So control over toe right out to the file and then enter to save it. So control Oh Then enter then control X to exit. That's using Nano. Why do you get branch? You can see him on Master If I do get LG or get log rather you can see emerged branch time work branch into you And so now I'll actually went back in time. I made a change and I've brought it forward in time, which is pretty cool. This gets to be quite a bit of time traveled to be totally honest, but it's actually pretty cool that we can do that now. As always, this does not show up in get hub because the last thing we need to do is get push origin Master, cause that's the branch we're working on. We emerged time warp branch into master So we want to push this up to get hub and do do do do do there it is time worked out Txt nothing in it And now we have three branches 22. files: All right, let's take a look at our read me file. So this is our read Me Fund. We've worked with this one's before. Now a read me is always written in this thing called a marked down language. Very good. Suppose is actually not really a language. It's just a way of, ah, shortcut writing larger titles, smaller titles, regular text links, things like that. And it's literally just called Mark down. That's what the read me dot m d stands for MD is marked down. Now, every project you have should have some sort of read me filing here, and at some point I'm going to change this, read me away from just get essentials with deployment, staging notes and all sorts of other stuff and put some actual information in here. Now Mark down is a very interesting way of writing new tax. Now, there are a lot of different markdown preview editors out there, but I always like to go straight to the source whenever possible and see exactly how get hub is going to sort of render this. So we've got get essentials at the very top here. But if we type get essentials with two number signs instead of just one. You can actually compare the difference here, so the green border just means that that's new, and you can see that this text is larger than this text. You can also make links, add lists, add pull quotes, things like that. I'm not going to go over all the different ways that you can write markdown because that's its own little mini course on its own, I think. But when it comes to writing mark down for a year for your project, you're probably going to want some sort of helpful information in there. What is your project about? What should the reader no? Are there contributing rules? Because sometimes there are certain rules for contributing to an open source project. If someone wants to get involved, how do they get involved? Do you have a certain workflow? They should follow anything like that That is generally useful information that you'd put inside of your read me dot MD file Now. Generally, I put anything that's I think is important as someone who is coming to a project for the first time ever. I want to see things that are going to pertain to me and and my interest involving this project, and it's also a really good way to just sort of look through here and see what the project is all about. So maybe you have a project that's just a react project, and it's just supposed toe render out some Jace on ified data from an Ajax request. You could write that in your read me file. So again, I'm not going to do anything with us at this time. I'll do that a little bit later. But what you can do and what you definitely should do is whenever you have a project, you should update your read me file as well. And actually, what I would like you to dio is update your read me dot MD file and then take a screenshot of it and update your skill share project. Show me what you read me dot MD file Looks like it doesn't need to be fantastic. It just needs to basically exist with a little basic information on it. Go ahead, give that a shot, and when you're ready, we'll head on over to the next lesson. 23. Viewing file differences: When you make a change to an existing file, you can actually see your differences before you commit them for me. I made a lot of little notes and little act to do so at at to do in my code. I just write these things all the time just to give myself a little reminder before I commit a file. So to see the differences in the file, it's really just going to show you the difference between the file when it was last committed and what you currently have now. And you just do that with get def and then file name dot e x t, whatever the extension is. So I'm gonna go ahead and edit a file here, So let's do vim read me. And again, you don't need to be using them. You could use literally anything else, and I'm gonna put a new line in here some new stuff in the read me and I just threw in some warm ipsum. So I'm gonna write and quit that file. And now if I do a get status, we can see that I've actually got a modified file of my read me here. And if I do get def. And I just take that name copy and pasted in there. Or just type it out. You'll be able to actually see that I got rid of this line here and get is actually quite clever. So I got rid of the staging notes title, and I replace it with how to use this repo notes. And I also removed how to use this repo notes with some new stuff in here. So actually, you know what? That was somewhat of a complicated demonstration. Just because get smart enough to realize that you have changed certain lines and we actually typed in Lauren Ipsum exactly the same way. Lauren, if someone's before, So that didn't change. So what I'm going to do is redo this entire example. So let's go ahead, and I'm gonna delete all that in them, and I'm gonna write some new stuff in here, so I just deleted all of that stuff. And if I do get status, I can Now do we get read me and get diff read me and we can see. There we go. This is a lot better. All this red is the stuff I deleted and the green stuff down here is the stuff that I added . And so now what I usually do before I commit a file is I will always, always do this. This is my flow. And this works really well for me because again, I add a lot of notes and comments and and two DUIs in my coat. And this just helps me remember what I'm supposed to do or leave notes for other people. So I do it get status before I commit and I do get diff read me and I go through it just line by line. Yeah, I don't want that. I don't want that Don't need that's don't need that don't need that Don't need that And that looks good. Okay, So if that looks good to me and then I do get status again because I always want to see what's in my and my status there. And ah, Then I could do, get add Read me if I'm happy with it. Otherwise I can continue modifying it and then I simply commit Read me update commit Not a really good message, but good enough for the time being. Good push origin Master Because That's the branch. I moan. And when I come back here, we'll see that my read me has updated. Now it doesn't just have to be your read me file. It could literally be any other file. If you have any other files that you've made any change on, you can do a git diff on them and you can see the difference. Green always means you've added something red always means you've deleted something. And in our previous example, can I still see that in the previous example? Yeah, Get was actually smart enough to realize that we just changed the title here. And technically, the Lord Ipsum that we wrote in there didn't technically changed. We deleted one, and then we pasted it in the exact same way. So get was like, actually, this line hasn't changed at all. So I'm not going to store this as a change because you technically haven't changed anything . So that's why I sort of wanted to move away from that first example. But that is how you do it. Get def. And in my opinion, you should always do it, get different all the files that you're modifying before committing them 24. How to ignore files: Let's look at ignoring some files because sometimes our computer programs will create files that we don't want to add. A good example is on a Mac you'll often see dot ds store on other computers. He might see dot icon or something like that that you don't want to. He added. To your repository, it's just not a useful file. So what I'm going to do is create a new file here called Dot to Do. And this is just going to be my personal to do list. And in here this is just going to be mark up, do a thing, do something else, and when I do it, get status. This will say I have a new file. I've got new untracked filing here. But what if I don't actually want to commit that file? Well, then I'm always going to have to sort through all my files I can't ever use get add dash a or get add dot because it's always going to add it Instead, what I can do is I can create a new file called dot get ignore, and once again you don't need to use them. You don't need to use Nano. You can use V s code sublime, anything like that. But this file needs to be called dot and get ignored is called a dot file. And in here, all we do is we put a list of files that we don't want. Do you commit So anything called a dot to do file. I'm also going to put dot ds store in here because we don't need that. And you know what? Maybe I don't want to commit any J peg files for any reason. So I mean, I get rid of JPEG files and J Peg files, but P and G's and gifts and all that they're okay, So we're now going to actively ignore to do files DS store J Peg and J Peg files. Now, when I do, we get status with this. My get ignore file will show up because that's new. But you notice that to do file doesn't show up. We told it that hey, get even though this file exists, just ignore it. Just don't allow that to be added to the repository. So now we can to get ad don't get ignore, get commit, added a get ignore file and get pushed Origin, master. And now, whenever someone clones this this project or this repository to do files DS store files and J pegs will not show up in here, they will not be able to commit them. 25. Create a custom Git alias: once upon a time I showed you this this little get LG tool that I have and I use Kama Kama glg because I have a text expander and it really just does this get lg And it does get long and expands all that stuff. But what if I wanted to get LG? What if I don't want to use a text expander? What if you're on an operating system where you don't have access to it? Get LG is not an actual command. In fact, this is called an alias. So we're going to an alias and we need to vim This is our root folder and then edits our get config. And in here all we're going to do is create a new line called Alias in Here and we're going to say L G is equal to And I'm just going to use my text expander because I have this stored somewhere and all it's going to do is run, get log and then all this other stuff. And in fact, that's actually not really correct because it does not need to run. Get this is a get aliases, so we don't need get in there It just needs to run log. Let's go ahead and save that. And now I can do get LG and it works. So that's how we add in Alias. And this is actually a much nicer get long. I like this a lot better than get log. This is pretty hard for me to sort of reading, and I personally like this a lot better. This way you can see where your code diverges and who made it. What time the commit message, the I d. Things like that. It's just all in a nice tree like this. Now you don't have toe stop and write all this out. I'm going to leave this in the description section down below er and your project files. I'll leave this somewhere available for you so that you can access this pretty easily because this is not something you want to type out by hand. This is something that you're going to want to just copy and paste. Really 26. Fixing Git commit messages: from time to time, we're going to make a typo in one of her get messages. So let's go ahead and create a new commit. But I'm going to purposely mess up my get message, so I'm gonna just touch new file. I'm gonna call this bad commit message dot Txt. And if I do get status, I have a new file in there. So get add that file. Get commit type of the word typo, Let's make it a serious type of the Ah, Tea boy Here. Now, if I do get LG, you can actually see that My typo is in here, but it's not quite pushed to get hub yet. That's good news. That means we can still edit it. All we have to do is type get commit dash, dash, amend. And this will open this up in vim or Nana or some sort of command line tool for you. You can't actually even sent this toe open up in V s code or sublime or anything like that . And I'm just going to delete this line and I'm going to say a typo here type of in commit message was fixed. And the ironic thing about that is I actually type of the word Typo, isn't that hilarious? Okay, eso I'm gonna say this with control. Oh, hit! Enter control X! And now when I do get LG, I can see a typo here. Type of and commit message was fixed and it actually fixed it for me. And now I can do get push, origin, master and all will be well. So that is how we do that. The trick is when you go to actually push your your work up to get hub, I always like to check my commit messages just to make sure I don't have the type of they still get past me from time to time. And it's actually okay. It's not really that big of a deal. No one cares too much if you have Ah, little typo in your commit messages. But if you really mess something up, there is a way to fix it. And just once more that command was get commit Dash, dash, amend. And that will just amend the latest commit for you 27. How to fork a repo: when it comes down to copying entire sources entire repositories, we can do a few different things. We can download it as a zip. We can clone it, but it's still sort of attached to this actual. You are elop here or we can fork it into our own profile. Now, forking really just means you're gonna take this entire thing and you're going to copy it into your profile. So if at any point in time you want to, you can actually come to this particular repository, hit the fork button and it will copy everything into your profile. And then you can clone that repo down from your profile using the the shur l or the https you well, but it's not going to say Get hub dot com slash Caleb Holley, and it's going to say get hub dot com slash your user name. So, essentially, really forking is just the act of taking an existing project and copying it to your account . This is, ah, global term right across. Get hub, get Labit Bucket. It's just a fancy term for saying, Hey, I I see that there's some code here and I want to copy it It's just a quick copy into my profile sort of feature. Now, if you ever see someone's work and you want to continue that work but you don't want But you don't necessarily have write access to the repost like if you were to clone down my repo here, you would not actually be able to make any pushes to it. You could not get push origin Master. That wouldn't work for you. Instead you'd have to fork it. And then you could clone your own copy of my work here. And then you could push to your repository, which is basically the exact same thing is my repository. Then you could do whatever you want to it. And because it's now your repository, you will have write access, whereas with my repo because of security, you can't just clone my rebo down and, you know, delete all my files and do I get push and then Oh, no, all my work's gone doesn't quite work like that. You need to actually have permission to do that. And for King, a sort of ah, way around that where you can still make all of your edits. But there, under your own account. Now. One thing to note is just make sure you look at the license. Usually the licensing is put in a license file in the repository, and it's often put in the read me dot MD file as well. The main reason why you want to look at a licenses just because something is open source doesn't necessarily mean that you are allowed to take their work and use it for building a company. There is different types of licenses out there, so you're gonna want to make sure that you got a little familiar with your licensing. Now, as an example, I'm going Teoh, just fork something in here. What I'm gonna do is, do, do do do Let's go look for Django, Django, Django. I don't think I have this fork yet, and so there's a lot of work, and here there's almost 28,000 commits at this point 20,000 forks. I don't have write access to this. I'm not one of the core Django developers. I can't just put things in master, but what I can do is I can fork this into my account by clicking this button, and I can say forget into Caleb Tully in a part of other organizations. So there's different options in there, and this is just saying forking. So basically, it's copying all of that. Get history and it's now you can actually see get hub dot com slash Caleb Tony and slash Django And I've guys all of the history in here. I've got all the different branches, and I can also clone this down to my computer, and I can push directly to master if I wanted to. I don't have to worry about having the proper permissions or anything, because this is now in my profile. Django also has its own. It's the master. But this is in my profile now, so I can do whatever I want with this, including if I wanted to, I could If it is this, delete this repository and I have to type that, but not gonna type Reynolds copy and Paste that and this is this will just delete it out of my account and put your password just to make sure and it's all gone. So now we don't have that in my account anymore, So that is really forking in a nutshell. It's really just a way to copy existing code from another repository into your accounts that you can do whatever you want with it. 28. Git issues: Let's take a look at a get hub issue now. An issue is not necessarily something bad. It's sort of mislabeled innocence. But really, all the issues are is a place to start a conversation about something in the code base. And so this allows you to bring a problem to light or to make a suggestion or to document a bug. It's not necessarily that the repository is broken, doesn't work or anything that although it could include that, it could just be smaller things as well, even like a type of like, Hey, there is a typo in the Read Me issues usually have labels, so you'll see labels. There's different types of milestones, and in this project there are no issues yet. So let's go ahead and create a new issue, and this issue is going to be make a better read me because currently my read me is not very good and I want to leave a comment and this comment is going to say you read me, could be better. And don't forget to always be polite, especially when you're dealing with open source stuff because people put in a lot of effort and you know they can't tackle everything. So, you know, they tried toe produce some code, put it out there in the open source source world, and hopefully when they get some time, they can fix it up or another contributor comes along and fixes it as well. I was going to say you read me. Could be better. Actually, my read me So my read me could be better. But I'd love some suggestions to make it more clear about what this repo is. And then I can preview my mark down. You can assign it to people. So, for instance, I'm going to assign it to myself. I can add a label. It's bug. Let's say it's Ah documentations also. Ah, good first issue, any projects or milestones, we're not gonna set any of those. I don't think we even have any of those said in there. No, we don't have any yet. Those are other get hub features, and I'm just going to submit this new issue. And now when you go to the code base, you'll see issue says one up here in the tab. Make a better read me dot MD. It's got a documentation and a good first issue label on it and really just says my read me could be better, but I'd love some suggestions to make it more clear about what this repo actually is. Now, you can make a comment on you if you want to, or you could comment and close in this case. Actually, all I would really be doing is closing the issue, and that would make this one go away. Regardless, this will always be searchable. So when you click on issues, that's all we're gonna say filter by if it is an issue and if it is open. If I had closed issues I could do is cold and closed. Or if I want to see all issues, I just get rid of that is close or is open tag. But that's really all in issue is now. When we get into pull requests, you'll be able to actually reference issues, and in an issue you'll be able to reference pull requests as well. So let's go ahead and headed this and this probably won't work because I don't have any pull requests right now. So suit test, Yeah, so I can only link back to this particular issue. But if I had a pull request, I could link to another pull request and say that this issue is related to a pull request or pull request is open and related to this issue. We'll talk more about pull requests down the line, and it will automatically link for you. So test number one creates a link and makes it possible for me. So this is a global thing right across pretty much everything. Get related. Whether it's get hub, get lab orbit bucket. Your user interface is going to look a little bit different, but an issue is an issue. I was gonna cancel that because I don't actually want to add that test in there. And I'm going to leave this issue open so that you can see it at any point in time. Now, what I would like you to do is go to my example. Repo. Get hub dot com slash Caleb. Italian slash get essentials Go to issues, and I just want you to open a new issue. It doesn't have to be about anything. You could literally just say Test issue, writes a little comment in their submit your new issue and it will bring you to a page that looks a lot like mine, where you can start a whole conversation around this, and then I want you to take a screenshot of this and uploaded to your skill share project. Once you're done that, we'll tackle the next section, called a poll request, which is a vital part of working with other people and comparing code. 29. How to open a pull request: Let's talk about pull requests and get hub. We have code issues, actions, projects, wiki all sorts of stuff that we can get into. But the biggest one you're going to use by far is going to be pull requests or maybe issues depending on your project. Now we'll pull. Request is basically saying you have some code that you want to incorporate into my code or I have some code that I want to incorporate into your code. And so, in this lesson, what I'm going to do is create a new branch and open a pull request into master. So let's go ahead. Open up a terminal, get branch. I'm on master and I'm going to get check out. Be so I'm just going to check out and create a new branch called PR test. And if I do get branch once more, we can just, you know, triple verify that were on PR test. Let's look at some code and we are going to Let's update the read me file. We're gonna update this read me file, and we're going to change this line. So let's at its our read me file and this line here to say something else. Master Branch. Let's actually you know what? Let's actually update this whole read me. So get essentials slash Get for everybody and then say this is ah course to teach you how to use every day. Get I don't know, of course, created by That's just me. I'm just putting some filler stuff in here, and that's good enough. So now I can do it. Get status to see. Okay, I do have a modified file I can get def. My read me. Although I have to type that right. Get def the read me file and you can see that I have removed the two red lines and I've added four green lines. This one is technically an empty line, but it still counts, as in addition. So now I can do, get add Read me because I'm happy with those changes. Get, commit, updated, read me. And because I'm on the PR test branch I want to do to get push origin PR test. And now when I go over to pull requests, I've actually got to recent branches in here. So it's going to show me too. But chances are you're only going to have one and so this has a PR test in your and I could compare and pull this request or if you don't have that, let's do the long way. Let's click new pull request. So what do we want to do here we want? We want to take code from our PR test and we want to merge this into master. That's what this is saying. So the code is going to go into master and it will tell us that it's either able to merge because there's no merge conflicts or there is emerge conflict and we might need toe change something in there. But there's no merge conflicts now. This pointed saying. I can create the pull request. Let's go ahead and create a pull request and I can give this a title and a comment. And I just wrote Sample pull request for the course. Now I can create a pull request or I can create a draft pull request and I was created Draft Polar Quest just for funds easa and so in here you can see that this is a draft pull request. It's not official yet, and when we're ready, we can say that this is ready to review. So let's go ahead. Review this and so now or pull request is actually open. It's saying that we want to put one commit into master from the PR test branch, and if anyone is ever trying to put code into your project, they're opening a PR on your project. You can simply merge the pull request. You can squash emerge appeal request. So if someone has a pull request with like 100 commits, you can squash him down toe one. Commit. That's actually a lot nicer for your get tree. Or you can re base and merge. Most people stick with a merge commit because it actually creates that emerge history. So that's what I'm going to stick with at any point in time. You can also set your reviewers people who should review. If you want to sign this to anyone, you can assign that if there are any labels, you can add labels in here. But I am simply going to emerges pull request. But before I do that, let's go ahead and take a look at this code. So I want to update this. Read me so this is our emerge request or are pull request and get lab. It's called Emerge Request in get hub is called a pull request. So this is what we're trying to add in here, that line that line and that line. And if we look at our existing code with currently in master, we can see none of that is in there. That's just the raw code. So essentially, we're just going to be updating the read Me file. Now there's another thing we can do is we can look through all the commits. Now this branch only has the one commit. And so there's only gonna be one in there and I can actually click this and I can see what was in this branch what was changed. Or I could just go straight into the files, changed tab up here, and I can see what's in here. I can also start a review so I can leave a comment or I can approve. I can submit changes you can actually see, though it says pull request. Others can't approve their own pull request. So this is where I get a little bit blocked in my demonstration because I can't prove my own pull request without creating a second get help account. But essentially, this is where someone would come in and leave a review. And if there were anything wrong with my code or there are suggestions, it will show up in the conversation in here under the conversation on and then you can just mark those as completed or resolved. Let's go ahead and merge that pull request, and it's going to ask me to leave a little comment and the actual commit message. Let's confirm that Merge, and now it's asking me if I want to delete the branch so I can delete this branch entirely from origin from Get Hub. I don't need this branch anymore, so I'm actually going to delete this. And now that branch no longer exists in get up. It still exists locally, but not in did Hub as another was a pull request. Done, and I can do get Branch. Let's get to check out and let's get pulled. Origin Master. There were some new changes in there. Let's let's cat the read me file. That's what it says. That's the new stuff that's from our pull requests. We've now opened a successful pull request and under pull requests, there are no more open. Now. If you want to look through closed pull requests, you can also just get rid of that tag and you can look through your pull request in here. And one last thing is I told it to delete that PR test branch and no longer shows up in your get Hub doesn't know about that anymore. But if I do get Branch, my PR tests still exists. So if I wanted to delete that locally, I could simply do get Branch Dashti PR test and get branch one more time and it's no longer in there. So in this video, what we did was we created a new branch, edited some files, committed it to a new branch, opened a pull request, explored the whole pull request thing, accepted the pull request into master updated master and then deleted the branch from get hub and from our local computer. We've actually done a lot in this fairly short video. Now, that's sort of just the beginning of pull requests. Pull requests are super super important. And whenever you have a poor request for your project, you're going to want to review other people's code. So just for example, we could go in here, see the files change. You're going to want to read through this and actually read through it line by line. It's important that you do that, and other people are going to try to do that for you as well. A good way to get code exposure and to gain from other people's experiences as developers. There's lots of other features in here. For example, you can click around and see what's going on in here. But you could actually see the rich text display or just the code display, and you could say this is viewed. If you wanted to, you could view the file due to do, and this is the actual file itself. You can see that it's a blob with the commit hash and the file. Now what I would like you to do as a fun little experiment is if you have not fork this repo already. What I want you to do is come over to my rebuild. Get hub dot com slash Caleb tully in slash get dash essentials, click this fourth button. This is going to clone. All of my work is going to copy this entire repository into your profile. I want you then to clone down this this whole repo from your profile. So this knew where I was going to be different? It's not going to say slash Caleb, Italian is going to say slash your user name. So clone that down using S S. H or https. And then I want you to make a change. Commit that file to your new repo, the one that's forth from here. So it's your new rebo, and then I want you to come over to my Rebo click pull request and open a new poll request . You'll be able to actually open a pull request from your new four tree bough into my main rebo and I can accept it. So go ahead, open up a pull request into my repository. Don't forget, the important part here is you absolutely need to fork this and you need to work off of your own copy of this code. And then when you're done that, I want you to take a screenshot of your poll request and update your skill share project 30. Undoing a commit: Let's talk about undoing a commit. There are two primary ways that we can undo some local work. And and let's just say that we merge them, work in from another branch. So we didn't get merge, but something went wrong and were uncertain of the changes. So maybe just as an example, let's say we actually merged in the wrong branch into master, which, by the way, has probably happened to all of us. At some point, we can undo our local work by resetting it back to a certain point in time. So if I do get log and I'll show you this cool little trick, get logged Dash, dash one line. You can see our get log with just one line of information. So we've got our hash head is pointing at our branch and origin. Master is exactly where we're at. We've got to other branches in here a little bit down the down the line as well. And in this video, I'm going to try to use get log instead of get LG because at school to be exposed to different features. So now let's say I made a commit and I wanted to come back to this commitment. I just wanted to undo it. How do I get rid of a commit that's already, you know, been put into my local get well, There's two ways of doing this. Weaken Do a soft reset soft reset or we can do a hard reset and the difference is really, really important. So we're going to go through both of these examples, so I'm going to create a commit, So I'm gonna create a new file here called sample dot txt. Get status and you can see I've got a new filing years. Let's go ahead and add that Get add sample dot txt and get commit with a message. Undo this. Commit to please. Now, if I do get long, dash, dash one line, you can see my head and master are now one Commit ahead of origin, Master. Now, just to simplify this example a little bit, I'm not going to do the whole merger that I was talking about earlier. But let's pretend that I'm urged in a branch and this was the merge commit. I'm looking at this get tree and I'm thinking, Oh, no, I definitely emerged in the wrong branch I didn't want to do that. I need to undo this. Well, we can reset either the hardware or the software. So when we do get reset, dash, dash hard and then a commit hash, we're saying, Undo everything up until that, Commit hash. So undo everything and delete it. Just get rid of it. So, for example, let's go ahead and I'm going to copy that. Put that in there now Weaken, Do the hash way or And said we could. Right, Origin Master, which I use more often just origin. Master just is a little shortcut to go back to where origin master is. Just because I always keep up to date with get hub to the best of my ability. So I'm gonna do that and we're just going to you get reset dash dash hard. Using the commit says head is now at the commit i d. And if I do get log, dash, dash, one line wound line, you can see my commit up here is now gone So that commit was undo this Commit please starts with F B 50 a 70 That one is now gone and now I'm back to origin master. And if I do get status, you can actually see that my file that sample dot txt file is gone. And if I do ls Dash L. A. There is no sample dot txt file So what I did there was get reset dash, dash hard and then your i d you're commit I d now one last time that is going to delete your work. So that might be what you want. That might not be what you want, depending on your situation if you don't want to delete your work. And let's say you have an example that we set up here, So let's create another file and get status Get at I'm gonna add all files and let's do it . Get status. We can see it. Get commit Undo this commit. But keep the file. Now we can do get log, dash, dash one line and just like the previous example, we have a commit. It's one ahead of origin master and we want to undo this, but we want to keep that sample dot txt file this one here. We don't want to delete that. Maybe it has some important information. We're not ready to get rid of that. We could do get reset dash, dash soft and as an example, I'm going to use origin slash master. That's this name here which is somewhat of an alias for this commit hash or, I mean, you could go back to any point in time if you really wanted to, but I'm going to use get reset Dash, dash, soft origin, slash master and when I hit enter get log, dash, dash one line. My committee is now gone. I'm back to Origin Master, where the way had a type own. Clearly I had fixed it. And if I do get status, my file is still there. It's ready to be committed, so it's currently staged. And if we want to onstage it, we can always do get reset, sample, get status and there's the file. And if we want to get rid of that, we could just RM sample its status. And now we have officially created a commit, committed it and undid the commit. So it's as if nothing even happened. And once more, we'll just do get log, dash, dash one line and we can see here. There's no commit. We're exactly where we left off before 31. Force pushing: Sometimes you'll need to go back to an older, commit and override all the newer stuff that get Hub has for us. So in the last video, what we did was we undid a local commit but actually has nothing to do with get hub or our origin slash remote. All we did was some local works. We caught the issue before we accidentally pushed it to get up. But what happens if we accidentally made a commit and push it to get hub and we wanted to undo it? Let's give that a shot now. So let's create a new file. Undo me dot txt is what is gonna be called. So get status. I've got this new file called Undo me dot txt Get ad. Undo me dot txt Get status. You can see it's staged. Get commit. I'm going to give us a message of root. Remove this. Commit from get hub Now If I do get push origin, Master and you can tell them on the master branch here. And this is my commit hash. I could just get push origin master and let's just refresh Get up here we have this. Undo me dot Txt file from the committee called Remove This Commit from Get hub. And so let's say this was a total accident. I don't know what happened and I accidentally committed this to master and I really need to undo this. Now. I'm going to say right now, move forward with a lot of caution with this particular feature. What we're going to be talking about is a force push. So essentially, what we can do is we can say, get log one line and we can effectively go back in time to any point in time we want. And we can say, Hey, push from this, commit up to origin, master up to get hub and overwrite everything else. But just so you know, it is going to actually delete everything else. So it's going to not only remove this commit, but it's going to remove the files and all the worth of that commit had and every other one . So if we decided to come back to origin time warp branch and we did a force push, it will get rid of all of this work, and you can't undo that. The other thing to make note of is, if you're working on a team that can actually cause them problems with other people. They're going to have to do a git fetch origin Master, They're going to have to do it, get reset probably locally as well. It's just not pretty, But the option is there if you ever need it. And occasionally you do need this. So I've already created that. Commit. It's on. Get a beer and I want to remove this. Commit and go straight back to a typo here. And so basically, I want to reset Master and origin Master, back to a typo here, this commit just underneath it. What we can do is get reset, Dash, dash, heart. And remember, from the last lesson that's going to delete everything. And then I'm going to grab this hash and just paste that in there. And now if I do get log, dash, dash one line, it's actually gone. But also so is origin, Master. And what I'm referencing there is remove this. Commit from get up! That's the old one. It just no longer exists. Now this is just with git log. If we use our fancy get LG Command, we can actually see that it is still here. Origin Masters actually ahead of us. So if we wanted to, we could do a get pull origin master and go ahead and get that commit. But we don't want to do that in this example. We want to override it now. If we said get push origin Master, we're going to see an error. Sure enough, Failed to push some refs basically get Hub has worked that we don't have. We need Teoh. Either do a get pull Origin master, and then get Push Or we can do a force push and overwrite this entirely. Let's do a force push and you're actually going to see something interesting that I have set up on my computer just to make sure that this isn't ever abused Get pushed origin Master Dash f Yeah, so it just says Nope. Forget origin Master Space space Dash F This is the flag for force or dash dash force. And so my techs expander is paying attention to what I write. And it's saying if I right master space dash f, it just replaces that tech. So I can't actually do it very easily. I can still do it if I had to spaces or do dash dash force. But it's just a little thing that I've added my computer just to make sure that this isn't , you know, easily abused. So I'm gonna hit Enter on this and what this is going to do is totally remove this. Commit as if it never happened. And with that, commit this undo me dot txt file is going to be removed. Let's go ahead, Force push. Okay, force push. We forced an update. Essentially remove. It was 15. Commits is now 14 commits that file is gone. And if we look at our commit history is no longer there. And let's let's verify that with their fancy get LG Command, get LG Origin Master is now exactly where we are. So just one more time. Use this feature very cautiously. I actually don't use this feature very often because there are other ways around it. But occasionally you do need to overwrite what get hub has. So don't use this feature unless you absolutely have to. There will be a time where you have to and also just keep in mind that this will make it a lot harder for other Debs on your team to work with this because now they have a commit on their computer. That one that was up here commit number 15. They're going to have that on their computer. And when they do a git fetch origin master, it's going to try to go back in time. So it sort of gets stuck in a little forwards backwards. Time trap. And that can be pretty hard for some other people to figure out. Now They're going to have to do a git fetch origin, master and maybe a get reset as well. But nonetheless, that is how we do a force Bush. 32. How to rebase: Let's talk about re basing. Merging is what everyone does, but it could actually become a really big problem. Your get tree can become super hard to read and understand. So let's take a look a target tree with get LG and we can see that you know, for the most part, it's not that hard to understand. We have these different lines, meaning different branches, and as we scroll down, we can see that we create branches. And at some point we've had two branches and merchant back into just one branch. And if you really just follow these lines in any visual tool on down the road will pretty much give you this visual implementation as well. And actually, maybe I could make that it'll smaller. There we go. We can see this tree starts to get a little bit bigger, and that's totally fine. But ideally, you want a nice straight tree. And so right up here is what you want. Just that straightness. That is ideal. But if we had 100 branches, this would stick out 100 lines and it would be way over here, and I've actually seen that before and it gets really hard to deal with when you have to do some get surgery. When you have to pull in certain work from certain branches into master and you have all these other branches layering on top of each other, It gets really, really difficult. But a rebased makes that nice and easy. Now you can actually see when we created Emerge, we had a time work branch right there that we created emerging into master and it created this merge idea. This merge hash so created its new commit. I think I just called that emerge ideas actually commit i d. But it created this new commit and then that basically said at this point, thes two branches merged together. Now, that's good for historical purposes. You can actually see what happened there, but a rebased won't do that. A re base will literally take your work and plop it right on top of master. So we're going to do a quick little rebased example where we're going to re base on to master. But you're not going to see this merge branch time warp stuff or there's another one. I know we've got a couple. Yeah, there's another one in here. Merge, Branch Master, you're not going to see those merge commits. So ideally, re basing is going to keep your tree your tree graph rather nice and straight and clean makes a little easier to to read and work with down the line and get merge will basically preserve the history, whereas a re base sort of rewrites the history. So I'm gonna go ahead and create a new branch here. Get check out be I make that little bigger again. Get check would be And I'm gonna call this re base branch. Get branch. You can see how my branches in here and I'm gonna create a new file touch Re base filed a txt get status, get ad and get commit. And this is just going to be called a sample rebased, I guess because why not? And if I do get log, dash, dash one line, you can see we're on a different branch. Head is on a different branch and we're one step ahead of origin, Master also, we could do our fancy get LG Command and you can see the exact same thing up here. Simple re bases on a re base branch and we're one step ahead of origin Master and our master branch. Okay, So to do a re base, we need to go over to master get check out master, and we want to re base the rebased branch on to master. So we do get re base and then the name of that branch, which was rebased branch. And it looks like it did a bunch of stuff. It was said, its first rewinding head to replay yada, yada, yada. But if we do get LG, we can see Master is now at our rebased branch again. I'll make that just a little smaller here. Sample re base. That's our commit head is at master. So we're currently on master and that's exactly where the rebased branches and you can see that basically, we took this re base branch and the commit in it and we just plopped it on top of master. We didn't create this secondary line. We didn't create a merge commit. We just said, Hey, just plop it on top of master. That's what rebased does now, in my opinion, the difference between rebates and a regular emerges, cleanliness and history. I like seeing a nice straight line, so I can always see what's going on at any point in time. But sometimes when you want to merge a branch and you actually want that emerge, commit in case you ever have to go back to that exact moment in that merge here it's a little bit harder and tell because, well, we re base. We don't have that merge commit. So if we wanted to undo this, we would have to actually know that a typo here or this particular commit is the one that we want to rewind to versus literally just looking at your tree and going. Okay, well, there's emerge here on then some work on top of it. We know that work was not working, but we want to go back to this emergency. If the merge was the problem, just makes it a little easier to read the timeline in the history using emerge. But a rebased keeps everything nice and clean. So, in my opinion, if you're working on a smaller project or smaller teams, I like doing rebased just cause it keeps things clean and you don't necessarily need all to commit history as well. But on larger teams or in pull requests or anything like that. You, for the most part, you probably want to do emerge emerge is probably the easiest way. 33. Resolving merge and rebase conflicts: a conflict is when there are two changes in the same file, basically in the same place. So let's say you and I were both working on the same branch in the same file in the same line of code, and we both wanted to put that into the same branch. We wanted to push it to get hub slash master. This is called a conflict. You'll see this with get pull pull request merges re bases. You'll see this all over the place is really just when there's one line of code that's been changed by two people or in two different places and get is not artificial intelligence. Get just is code control, really? And so it says, Hey, you've got a conflict here and you have to pick. Is that either a or is it B? Which one do you want to keep? Or do you want to edit it and make a hybrid and use that? And so a conflict really only happens when get needs you to make a decision about a particular line of code, So I'm going to do two examples in here. I'm going to show you a merge conflict, conflict and I'm also going to show you a re base conflict, and they're almost the exact same. But I thought it would be good to demo both because you're going to be using merge and re base in the future anyway, so you might as well see both. So I'm going to set up our repo here on get Hub, and I am going to create a new file, create a new file, and this is going to be called Merge conflict dot txt And we're gonna say line one by get hub and let's copy this over and over again. And I'm going to set this up as the example. So we're going to have a new file in here with five lines that says line 12345 by get up because we're making this file on get hub. And I will say this committee is called added merge conflict file and we'll committed directly to master. We don't need a branch for this. Okay, So now, master has this new file called merge conflict dot txt. I don't have that work yet, but I'm going to sort of mimic this flow by creating a new file Ah, that's vim This FIM merge conflict dot txt So it's the exact same name you can see merge conflict dot txt here and merge conflict not txt here. And actually what I want to do is I want to do a sloppy copy and paste just paste that in there and I want to change lying three. And instead of the number, I'm gonna put the word and I'm also gonna say Ah, edited locally. Save that file. Let's get status and let's let's try to commit this. So get add that file, get commit, merge conflict file added locally and now we know we can't do it. Get push origin, Master because master has some work that we don't currently have. So that's going to be a problem. But we can do a get pull origin master and maybe Allah clear this up. So get pull origin Master and this is going to try to get that file. But it's going to conflict with the file that we have on our computer and so you can actually see if we just read through this auto emerging merge conflict a txt There was a conflict and the automatic merge failed, so the merge wasn't able to happen, fix conflicts and then commit the result. So it's actually telling us what to do here. So if we do it get status, we can see that we've got both of us. Added both get Hub and me. Or if you and I were working on this project, you added it and I added it. We could do get def merge conflict dot txt and you're going to see this kind of stuff in here. So you're going to see a bunch of less than signs and then it says head and then a bunch of equal signs and then you know, your code inside of that and then a bunch of greater than signs with the commit hash. And so really, all this is saying is, Hey, this is where the conflict is. Which one do you want to keep? So let's do ah, them merge conflict And we can see in here that if I set the number online 35 and seven, there's this weird stuff and we need to get rid of all of that weird stuff. So at this point, the code is being separated by these equal signs. Do we want to keep Line three as in the word edited locally? Or do we want to keep the number three edited by Get Hub? That's up to us. There's no right or wrong answer at this point because there's no context of a coding problem. But if there was, you might want to discuss this with the other person who has worked on this already. So what I'm going to do is I'm going to delete that line to leave that one, that one and that one. And now it looks like a regular file again, and I'm going to keep three spelled out, edited locally, So I'm just going to save that file. And again, you can do this in V S code or sublime or Nano where any text editor you want. If I do get status, you can see nothing's really changed, But I need it now. Add that file because it asked me to commit that file. So if we scroll up, it says, fix conflicts and then commit the result what? We fix the conflict. So let's commit the results of get ad, merge conflict, and let's simply do get commit no messenger anything. Let's just to do a commit. And now it's saying Okay, well, we can make that commit. Merge now or that merge Commit now control over to say that in nano control X And just like that, we have resolved a conflict. So let's do get That's to get log, dash, Dash one line. So now origin Master, we haven't done anything. We haven't pushed our code up yet. So Origin Master is exactly where it left off. We added that merge conflict file on get hub dot com. Then we added emerge conflict file locally on our computer and we tried to do to get pulled . But there was a conflict. And so this merge this merge commit here is saying, Hey, that conflict was resolved and now we can do get push origin master And let's just refresh this file and now we can see that it was edited locally. So when it comes down to resolving a merge conflict, really, all you have to do is edit that file so you can always do get status and you'll see the file in there so you can always edit that file. You can see the difference is writing your command line using get def. Or you can just open up in V s code or or sublime, or Adam or any text editor you want to use clean up that stuff that get has automatically added into your file for you. And then you simply get add your file and when you're done that get commit with no message , just get commit, and then you can write your message in that that prompt that it will give you now re bases a little bit different. So now I'm going to demonstrate a re base conflict how we can resolve that. So, first of all, I want to make sure in my master branch, and I'm going to create a new file here. Them re base conflict dot txt. And I'm going to purposely do this in Master. I could also do this on get hub like the previous example, But we're not going to do that. We're going to do it right in the editor there, right in our terminal. Rather So I just pasted this in here. We've got line 1234 and five by get hub, I'm actually going to add one more line in here and say not from get hub. This is from local. Just cause I'm going to be a little lazy with that context, there doesn't really matter. We're going to work through a conflict. That context, the actual written stuff that you see in this file currently is unimportant. We need to fix the conflict, not necessarily the code. So now, if we do it, get status. I have this file and I'm going to commit this. Commit three bays conflict example file example. And yet you're right. I can't just commit that. I have to get ad that file. Get re base. Yeah, get add rebased conflict. Nailed it. Now I can do my commit. And if I do, get LG or get log or get logged one line you'll see it's in there. Get log, dash, Dash one line. That committee is now in master. Now let's let's go back in time. Let's go back to this. Commit here and let's create a branch from here. So get to check out this commit get log, dash, dash one line. You can see that we're in a headless state. Our head isn't pointing to anything we're actually just where Origin Master is. Let's create a new branch, get check out rebased conflict branch. And if I do get Branch, we can see it in here and I'm going to create the exact same file again. So I'm going to vim re base conflict dot txt And I don't even remember exactly what I wrote on that line six. But I'm not going to worry about that. Get should automatically add that in there for me, because there's not going to be a conflict currently is going to be no line online six here But there will be a line six on Master and get would know how to merge that together and in here we're going to say three and also we're going to say five So we'll do two examples in here Now again, I've just recreated that exact same file on the rebased conflict branch and if I do it get status. We have that same file rebased conflict. Txt. So it's add that file, get commit rebates, conflict file from a branch and if we do get LG, this is where this really comes in handy. You can see that there was a merge into origin. Master, this is we're get home things. We are origin. Masters always get hub or origin is always get hub Masters. The branch master has sort of straight off a little bit. Eso there is a commit and they're called rebased conflict example And that's an hour master branch. And in our current branch, the one where our head is in the rebates Conflict branch rebased conflict file from a branch. And so these two master and Rebates Conflict Branch have the exact same file. But there's different contents in it. And now we want to re base this branch on to master so that we don't have this little divergence here. So let's get check out. Master, make sure I'm on that branch and get re base Repays conflict, you French And all this is going to do is give me a little bit of an error. And again if we just read through this I know it's like a wall of text, but if we read through this, we can actually see how to deal with this. So there was a conflict. Ah failed to merge in the changes patch failed at 0001 rebates, conflict Example. Use. Get a M show current patch to see the failed patch. We're not going to get into patching because that gets a little more complicated. But we can also resolve all these conflicts manually, and we can mark them as resolved by get adding, or get removing the conflicted files and then simply as simply running. Get rebased, dash, dash, continue. Or if there is nothing to to skip because occasionally, when you do a re base and there's a rebased conflict, there's actually not the conflict get just as I just want you to double double check this. And if there were no problems, you could do get rebased dash, dash skip So it's to get status and you can see that we both added both on Master. And in this new this new branch, we added rebates conflict dot txt. Now, at any point in time, you're like, Oh, uh, I'm not fully confident when I'm doing you can really do two things. You can continue with this. Ah, and I'll show you have to do that in just a second. Or you can always get rebased dash, dash, abort Now, if you continue and you're not totally sure about what you're doing. Don't forget. You can always get reset. Dash, dash hard or get reset. Dash dash soft so I don't want to abort this. I don't want to skip this. I want to see what the difference is here. So if I do get def, you can actually see get things that I actually changed line for. But I didn't, and that's totally fine. Ah, and it also thinks that there's some stuff in here, so we actually have an interesting example. You're here, so let's let's edit this file and again, you don't need to use vim or Nano or anything I'm using. You can use whatever you want to use this code. Sublime Adam, any text editor you feel comfortable with. And so if you just open this file, get will have edited it for you. And so it's saying there's a conflict here, lying 34 and five. And so now it's our job to tell. Get which lines are correct. So I'm going to delete this line. Ah, I want to keep 34 and five. That's correct. I want to keep that work in there Ah, and then this. This and that world duplicates. And now I've got a hybrid file line. 12345 by get hub. Plus that extra line six in there. So if I do set number, you can see in line six here not from get hub. This is from local. That's from Master Technically. And so I've got this hybrid file and all he did was really smashed the two files together and say, Hey, keep these particular pieces. And so I kept one line from what was coming in from Master, and I kept the other three lines that were coming in from the rebased branch. Now all I have to do is save that file and follow what it told me to dio, which is due to do to do do it will tell us all appear so get add the file then the conflicted file name or files and then get rebased Dash, dash, Continue. Now we only have one file, but I have resolved that conflict. So if I do it, get it If we can now see there's a proper diff in here. There's none of that less than less than less than less than equal, equal, equal, greater than greater than greater than signs Then a this ugliness in there. So we got rid of all that. And now we have to do and add get ad repays conflict a txt uh, get status. And then we don't commit this because we're doing a re base. It actually tells us here all conflicts fixed. Run, Get rebased Dash dash, continue. Get rebased dash dash continue applying rebased conflict Example Ah, And then let's do get log dash, dash one line online We are online but also online and one line So this is our get log dash dash one line We can see that Master now has this rebased conflict example in here And if we do get lg make that a little smaller We have this nice straight line So we originally came from origin Master. That's where we started this video. Often we branched into this other branch and then we re base it on to master and we have this nice straight line. That's the nice thing about re base. So to recap very, very quickly, when you're working through a get merge conflict, you get add the file or you change your file, actually first, then you get at it and then you get, commit, get, commit, and that will create a new merge. Commit for you with a re base. You do get re base and then you change your file and then you get at your file. Whatever that conflict was. Assuming it's resolved, you can now add that, and then you do get rebased. Dash dash continue, so there's a slight difference. But resolving a conflict. Either way, it's the exact same. You're getting rid of these symbols inside of your text and you're just telling Get which one to use in which one not to use or which lines to keep. Or maybe you're creating a hybrid of incoming changes and older changes. Who knows? But that's up to you to decide. And that is how we resolve conflicts using, get, merge and get re base 34. How to stash code: in get we can stash some code for later. Really, this just means save it behind the scenes. Don't show it to me right now. And whenever I do it, get status. Just don't even tell me it's there. I just want to hide it behind the scenes and maybe access it a little bit later. Now, this is most useful when you're trying to switch branches, but you actually have some work that you don't want to commit, and you also don't want to lose it. So let's say you're working on a feature branch and you know you're working on this new project and you're just working, working, working. And then someone in your company comes up to you and says, Hey, I need you to quit what you're doing, and I need you to fix this other thing. It's way more important. We have a bug in production, and it needs to be fixed, but you're halfway through this working like I. I don't want to commit this, and I can't necessarily leave this in the branch because it's going to be it, you know, a little difficult to work with or worse, you're already editing a file that also needs to be edited in another branch. This is where Stash comes in. Stash basically says, Save the file behind the scenes. Let me do whatever I want anywhere else. And then I congrats that stash. I think of it like a like a treasure chest full of code. I can grab that treasure chest full of code. I can open it, and I can reapply my code a little bit later. Okay, so I'm just going to create a new branch here as an example. So get branch Stash example. We actually haven't seen this before. I've been using Get Check Out to Dash B, but this will just create a new branch that we haven't checked out yet. So get French. You can see that it's in your now under master what's called stash example, and we can do get check out stash example. Get Branch, and we're now on our stash example. So let's say for whatever reason, I'm working on the read me file, but I get pulled off of this work and I need to go into the master branch and do some work . So let's vim the read me file or V s code Read me file or anything like that. Some other work in here by the Stash branch, and that's all we're doing. So we just edited that file. I do it. Get status on get def. I've changed the read me file and I've just changed that one line, and I've done that in the stash example. So if I do it, get status here, you can see again. I just have this one little file on and I changed one line in it. No big deal, but what say Let's say I'm not done. I simply can't do it. Get ad and then I get commit because I don't want this in my get history. I'm not done with this yet, but I get pulled onto something else. Well, I could simply do get check out, Master. And if I do get status, that file is still changed. If I do get def that change for my other branches now in my master branch, you see that I'm in Master Branch here and it's changed Well, what if I actually needed to make a line changing your in the master branch and in my feature branch, but they had to be different. Well, now I've brought over my work from the feature branch into my master branch, and that's just not going to work. And in some cases, your get actually might even give you a little bit of air saying You can't do that, please. Stash. So what we're going to do is get check out the stash example Branch, get branch, get status, and I'm going to do get stash. And what I'll do is put that the middle of the page here, get stash. And so it saved the working directory and index state work in progress on my branch name, and it was created from this particular commit. That's the commit that I'm currently on. So now if I do get status branch on Stash example, there's nothing there. If I do get stash list, you can see a list of stash is that you have. I've got one here, and you have as many as you want and these air not unique to a branch, by the way, this is global. So I've got stashed at zero working progress on stash example and then just that commit. But now we can go over to get check out, Master, You can see him on the master branch, and I can also add it to read me here. Read me file. And I'm going to change this line to say something else. Now, this is on the master branch, and in fact, what I'm going to do is just say, master branch dress, so we know. Get status. Okay, I'm on Master Steward, Get def. You can see that. That has changed. I've added Master branch text in there. And now I can commit this so I can say get commit worked on Rush Tasker. Ah, Rush issue. And actually, I can't do that. I need to not get def get add get add to read me and then I want to get commit. So now I can do get log, dash, dash one line and you can see I worked on the rush task in master. And my stash example is totally somewhere else actually. Let's say we get algae. This will be easier to read now in her get lg. This is actually really cool because this will tell you that you have a stash in year. You got a work in progress on Stash example. So let's go ahead and get back in there. Get check out stash example, and we're just going into the stash example. Branch. And if I do get LG, the only thing that changes my head is now pointing to stash example. Why do you get stash list? There's one in there, so let's let's now apply this list. Let's do get stash, apply and I make that bigger and move that into the center of the screen so you can see this. Get stash, apply, get def and you can see that is not from the Master Branch. It's from the Stash Branch. And so now I've got work in Master that have already committed and I've come back here and none of my my progress was lost. This is like a really nice temporary save feature. Now, if I do get LG, you can see that the refs to the stash still exists. And if I do get stash list, it's still there. Now I want to get rid of this because I've already applied this and I don't need it anymore . So let's do get stash drop, and that will simply drop the latest stash. So if you've got multiple Stashes, it'll just drop the latest one. And if I do get stash list, nothing shows up anymore. And if I do get status or they get status, my work is still in there and you can see some other work in there by this stash branch. Now, at this point in time, I could re base this into master. I could merges into Master. I could do something with that. Now, the whole point here is that I'm actually a feature branch and I was able to save the work in progress, stuff that I have go do something else with some other code, as if it had never changed in the first place. Make my work, do whatever I had to do over here. Come back, and I could reapply my work in progress stuff and pick up exactly where he left off. That's the power of stashing. I use stashing almost every single day because I have to change tasks fairly, fairly often. It's also really, really useful if you have a bunch of work that you're working on, but you ever, if you ever have to, like, check out another commit if you want to see what used to exist in a commit, maybe like five commits ago. So we're currently here, but maybe we wanted to reference some code that's down here. We would do it. Get check out de zero E A B e d. That would put us in her detached head mode. I would have a stash up here, so that's OK. I could come back here, I could check things out, and then I could check out my stash example again and reapply my stash, and I would never, ever, ever have to worry about losing any of my work. 35. Adding tags to your commits: in get There's this feature called Tagging. Tagging is a way of marking a milestone essentially in your git repository. So you want to tag something that is important? Typically, this is used for aversion ng s. So if we take a look at, I'm gonna open up a new tab here. If we take a look at Greg Tail slash wag tail, we're going to see all sorts of tags in here. So we've got all sorts of branches in your on the official wag tail repository for all these different stages or versions, and it's just in development work. And then we have tags to actually tag entire chunks of work. So all of the wayto 2.7 work is tagged with version 2.7 and you can think of this sort of just as a shortcut to a particular commit. So instead of having to go through this branch and look for the latest commit because, you know, there could have been more commits after 2.7 was launched and actually there was there was a 2.7 point once there wasn't code changed. This is just going to link to a particulary commit for us. But the nice thing about this is this is a tag, so we don't get like, this huge get hash. We can actually work with a tag name. And so what we're going to do in our repository is under branches are where it says, Branch Master, We have all these different branches, but we also don't have any tags. So let's go ahead and create a new tag now. So I'm gonna do a get long dash dash one line, and I am on worked on Rush Task That is the commit that I'm on. Let's go ahead and tagged this particular one. So my head is on this commit. That's where my program things I am. So I'm going to create a new tag here with get tag and then I don't know, v 0.1. And if I do get log dash, dash one line, you'll see there's a new tag in your tag V 0.1. Now, this is not on get hub yet, just like everything else. We've only worked on this locally, and we haven't told get Hub that this actually exists, so we're going to have to push that up in just a little bit, but we can also see a list of our tags by simply typing. Get tag Now, if you have multiple tags, this is not necessarily in order. This is an alphabetical order. And so just because one tag doesn't come before or after another tag really doesn't mean anything. It's just alphabetical order now, like I had mentioned, this is not going to save your tag and get hub in order for get up to know that this tags exist. We have to have to push this tag so we have to do to get push origin. And then the tag names OVI 0.1. It says new tag V 0.1. So let's go back to get hub and refresh This page now undertakes We have V 0.1, and that's going to bring us exactly to where we currently are. It just happens to be that get long, dash dash one line. This tag happens to be exactly where I am on master in my local host on my computer, but also that's where get hub slash Master is as well. So let's go back in time and Let's also tag something else. That's let's tag the type of one in here. Let's grab that commit idea. I just copied that. Get check out and now you can see that head is at the typo. I'm in detached ways to say you are in detached head State Get log, dash, dash One line and you can see my head is here. So if we even did get LG with our fancy get LG Command, Let's make that smaller. Our head is right here. Master is up here, but we're way back in time. So we're in a detached head state Now let's add a tag here. A tube. Get tag! Uh, call it. Did a typo tag and get LG and you can see that we now have a tag in here. Let's also go back, Teoh. Read me! Update commit. So let's grab that one. Get check out and you can see my head is now back here. And so I want to take this one too. And, I don't know, maybe take it with get tag. I don't know beta or alfa or I don't know something like that. And you can see that we've added attack. Now if we want to push all these tags up all at once, we can do that with get push origin origin, dash dash tags. Make that bigger and I'll actually center that. So get pushed origin dash dash tags and wait for it to do its thing. And the real we've got new tags. So let's refresh our get hub page and we have the different tags. Now, if I go to like Beta, for example, you can actually see I don't have all the files that my master has master as a bunch of other files. But Beta doesn't because we went back in time and we tagged it. Now let's say you accidentally tag a commit and it's it's the wrong tag or it's the wrong commit. Let's go ahead and delete a tag so we can do get tag and you can actually see again. This is not in any particular order. This is just in alphabetical order. So we wanted to delete typo tag because let's say that's not actually useful. Who cares? It's a type of no one cares that much about a typo. We could do get tagged D and then the tag, Name, Typo Tag and then get take again. Okay, that's gone from my computer. But not gone from get hub so as to get pushed origin, dash, dash tags. Oh, no! Well, that doesn't work. The reason for that is because we're not adding anything. We're not pushing anything to origin. We actually want to delete it from origin. And so this is a slightly different command. Wow! Sort of similar, actually. But it's get push origin and then dash, dash, delete. And then the tag name and that tag name was type O tag. And that's going to delete it for us from Get tub. There we go. Tag was deleted. And so I just refreshed my page there. And if I go back to tags, Typo tag is no longer in there. Now, why is this useful? Well, let's do this. That's get check out, Master. So now we're back in an attached head state. We could do get LG, and you can see here is master tag V 0.1. But let's say I wanted to jump down to the beta tag wherever that was. But like I'm not going to remember this commit hash you're not going to remember this Commit hash and it makes no sense to remember that. So what we can do instead is we can say Get check out, Beta. I got a spell. Check out right, though. Get check out beta. And I'm just getting that from the tag name here. If I do another get LG it skipped us right to the beta tag. Get check out V 0.1. Okay, let's get LG. And our head is back at this tag. Now. We didn't actually check out a branch on this one, so you'll notice that the head is not actually pointing to any branch. This is where Master, is this where origin Master is This is where a tag V 0.1 is. But our head is not attached to anything here. So in order to actually attach that, we're going to want to get to check out Master, we want to check out the actual branch name and to another get lg. And now you can see head is pointing to master. That's what we want. So by now you should have your own Repo hosted on Get hub. I would like you to take your last commit and push that take and then take a screenshot of that tag. So essentially it should look like this. You've got branches and you've got tagged. Just take a screenshot of this with your tags in here, you might only have one tag. You might have 30 tags. That's up to you, but I just want to see a screenshot of your tags in here. 36. Final lesson: Okey dokey. You have made it through this entire course. We've gone through a lot of different things as a quick little summary of what you've learned. If you've taken this course from scratch from the very beginning to the very end here, you've learned basically how to use get on the command line, which is really important because, you know, on a server there's no graphic user interface. There is no visual tool you've learned how to install. Get onto your computer how to configure, get how to add your ssh key cloning a repo creating a new repository All sorts of stuff in there We've created branches, open pull requests we've dealt with staging files, un staging files undoing commits hard resets, soft resets get logs. A custom get alias called Get LG. We learned how to pull and fetch What read me. Files are how to ignore files. How to fork a repo, how to open up, get have issues. We've talked a little bit about code reviews, and we even dug into force pushing, which again, be very careful with. We also looked at merging branches versus re basing branches and dealing with conflicts. Both merge conflicts and rebased conflicts, stashing your work and also adding tags. So basically, this is your entire daily workflow. I shouldn't say daily, maybe weekly. You're going to use pretty much all of these features on a weekly basis. When you start working with a team now, there is a lot that you can do with get and get up or get lab orbit bucket. There's actually more that you can do with get lab, then get Hub. Get Hub is the brand name. But get lab really pushes the whole continuous integration thing. And they really vouch for, you know, perfect develops, whereas get Hub is more about the code, I think anyways, that might change in the future. But so far we've covered the regular workflow for pretty much most projects you were going to run into in the future. But if you are interested in continuing to to learn and to practice your get skills, I'm going to highly recommend two things. 1st 1 is this website called Learning. Get branching dot Js dot organ. This is interactive. Get for you so you don't actually have to do all this stuff on get hub if you don't want to , although it's I think it's better practice if you do it, sort of live with, like, get hub. Ah, but if you wanted to get into other things that maybe I didn't cover, then you can totally use this as a really, really good learning to, and it's all interactive. So, for instance, I'll just quickly walk you through this. So we've got commit zero and commit one, and it's going to walk us through. This is going to try to teachers how this works and get flow. This is a lot more visual. So for visual learners, you're going to absolutely love this tool. This is really great. And I use this when I was first learning Get as well. This was a really useful tool for me. Now, if this really isn't your thing and you would rather a book, I highly recommend going over to book stuck gold kicker dot com slash get book. And this is a very extensive book. There's do to do to do wow, 61 chapters. There are things in here that I didn't cover, and there are things in here that you simply are not going to use on a day to day basis. It's just not something that you're going to use too often, but this is a totally free book. You can just download the PdF bucking to see. It'll start downloading for me. You can't see that's off my recording area. It's downloaded the book for me for free, and you can go through all this advanced stuff. This stuff is really, really cool to know. But again, not all of it is is super useful. Everything you've learned in this course is what you're going to be using on a daily or weekly basis. Everything else might be a little bit much, but if you really want to become that, get wizard. This is the book for you, and again it's totally free. Lastly, if you wanted to take all of this stuff to the next step to the next level, you could also look into setting up continuous integration so you might want to Google that word. Continuous integration. Ah, there are tools out there like a Circle C I and Travis for adding continuous integration or C I into your project, and that will do all sorts of things for you can make sure that there's certain formatting you can make sure people don't have comments in your code. You can make sure nobody writes two DUIs in your code or if you're happy with where you're at. Honestly, you now have enough get skill to go work with the team. You know everything that you need to know in get to work with a team. Even fairly advanced developers who have been using get for a long time tend to use these kinds of tools over and over and over again. So you already up to date with what I would say senior developers are using when it comes to get. Lastly, my name is Caleb Tallinn. Thank you for tuning in and taking this course. I really appreciate you. Taking the time get is an essential tool, but it does not have to be complicated people over complicated, and it's just unnecessary. So I'm glad you took this course. And if you like my teaching method, don't forget I have other courses available all over the Internet. Just give me a Google again. My name is Caleb Tallinn, or feel free to follow me on Twitter