GIT tutorial for beginners | Maksym Rudnyi | Skillshare

GIT tutorial for beginners

Maksym Rudnyi, Teacher and YouTuber

GIT tutorial for beginners

Maksym Rudnyi, Teacher and YouTuber

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
22 Lessons (2h 28m)
    • 1. Introduction

    • 2. VCS Concept

    • 3. Version control types

    • 4. Why Git

    • 5. Download, install and configure

    • 6. Create a GitHub repo and clone it

    • 7. Pull from remote

    • 8. Git GUI and gitk

    • 9. Inside .git folder

    • 10. Undoing changes

    • 11. Git reset

    • 12. Git revert

    • 13. File .gitignore

    • 14. Branching and merge

    • 15. Conflict resolving

    • 16. Git rebase

    • 17. Cherry-pick

    • 18. Git tags

    • 19. Stashing

    • 20. Remotes

    • 21. Branching strategies (workflows)

    • 22. And one more

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

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


Are you front-end developer or back-end, in gaming or fintech development - doesn't matter. Version control system - is what unites us all. We work in teams and have to coordinate our work and code to deliver a high-quality solution.


Git is the best tool to control your code. Learn concepts of Git to simplify your work!


Course Outline

Course Introduction provides an introduction to this course and the Git source control system and sets the stage for the rest of the course.

After the introduction, the first thing we do is Git Installation for both Linux and Mac.

Quick Start a very quick, hands-on Introduction to Git. We start off by signing up for GitHub, creating a repository there, the makiing a local copy (clone), local changes (add/commit) and then update GitHub with our changes (push). Additionaly, will generate SSH key and upload it to GitHub account.

In Basic Commands, we walk through all the foundational commands needed to start a new project managed by Git (or enable Git for an existing project) all the way through making commits, including common file operations like moving and deleting files. We also cover how to exclude the wrong files from accidentally being committed and how to review your repository's history

With a strong foundation in place, we explore ways to make Comparisons in Git, including all the different local states, between commits, and between local and remote repositories.

We give great attending to Branching and Merging in Git. We start off with the simple "happy path" and learn about "Fast-Forward" merges and how to control them. The we walk through common "automatic" merges. Finally, we cause trouble on purpose so we can step through resolving conflicting merges with our visual merge tool.

With a strong foundation in branching and merging, we will then cover a more complex topic, Rebasing. In that section, we cover several rebasing examples, including how to resolve a rebase conflict.

In the Advanced section, we save our work-in-progress while we attend to more pressing issues, then pick up where we left off after that. We'll cover git tags and stashing local changes. One of the most important part here is branching strategies. How can we use Git.

Meet Your Teacher

Teacher Profile Image

Maksym Rudnyi

Teacher and YouTuber


Senior Software Engineer with more than 8 years of production experience in Web Development. Experienced both in frontend and backend technologies.

I would like to share my experience with others. You can find courses in Web Development (Front-end and Back-end) and specifically JavaScript. Use this knowledge to improve yourself as a professional developer.

Keep learning!

See full profile

Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Your creative journey starts here.

  • Unlimited access to every class
  • Supportive online creative community
  • Learn offline with Skillshare’s app

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. Introduction: Hi there. My name is Mason and I'm a software engineer with more than eight years off production experience. Today I started new course. It's a get get for beginners. So in this course, I'll show you Why do we need to get and why you have to use it? Because it doesn't matter. I front and engineer or back and engineer or you are just beginner or I experienced developer. You have to know, get and you have to know washing control system, any of them. So it is Course I will start from the simple. It will be hard to install git Who's some changes? All changes from the remote server. How can we resolve conflicts or reset the latest changes? In the end, I will show you hard to work with remote reports stories and how can which Jews? The optimal branching strategy? Um, I will. So how do we use get on our every day work and Hakani? How can you use it? So good luck and let's start 2. VCS Concept: in this video, we'll talk about concept off version control system and take a look how we can organize it or take a look on options. How can be organized such a system? How can it be built? Let's let's imagine that we have filed because a fire was off the mark up for Schemmel. Andi way. Have a title. We could let me start some some value and actually that some manager came to us and said that we should update it. And we have another version with a new version off this title. After that, in a couple of hours, somebody else games to us and thought that it should be changed again. Andi should be built dynamically, so we updated it again. And after that somebody came again or requirements of a change. And we have a new version with the materials that the 1st 1 goes when title should be said that chemical hot call it so as a result, we can see him that we will have a lot off copies off the same file. And if you, in case you have a lot of fire see, can put it in different folders and then make copies off this folders. A lot of US developers who started to justice they work. They work in this way. They have a copy off each product, a few copies of these different changes. But what's bad in this case that you have a lot of fires and you don't know how it was changed, what was changed and who changed these and just opening information off this folder you can find when it was changed and maybe some comment, but it's not a good idea after that. You can try to use some cloud systems, for example, Google Drive or Dropbox, but it not can to solve the issue of Easy or cordon your Suffer, because when you write your program a lot, the auto fires a lot of changes, and they need seen some cop's data and cloud. The perform doesn't work well for your court, and that's an option it can be. You can try to sherry or file in your local network with us and developers and try to do work on these files with a few different peoples. But the issue is that the court will be or written by another developer, for example, if you doing something and you have it was the last version. Somebody else can rise this fire and your version will be outdated. So it's not a good approach, but what is good? It's a version control system, something like it. So let's take a look on requirements for such a system. So requirements it should have backup and restore option. So what does it mean? It means that a record that the court you are creating it should be saved and the all abortions should be saved. And in any case or in any moment, you can go back to the previous version on and you can get the data and you can get the data, especially what you need. The second item. It's organization. It should allow to see her nice work off one to free 50 or 100 developers, and it'll also do one work together for all developers, and you should be aware and should know that your changes wouldn't be deleted or removed. Somehow you can get the latest data. The latest version she eggs difference and who's updated version based on your changes and changes you get from the server, the sort requirements, it's Ah, reverting changes. So in any moment you can revert are think what you did and to go to the previous version and be sure that everything will work fine. Okay, The next requirement. It's a track changes and ownership. It's very important part. So, for example, he opened you open file and see that these some changes and you don't don't know how it works. I'm a complex algorithm or some difficult change. You can always find the authorship of this change is who did it and to go to him and ask why it wasn't a matter in such a way and what was changed and why it was changed. Also, in this case, you can check what specifically he changed and what was before what was changed. It's a very important part. The next one. It sent box and send books, and it's the place where you can put some some your experiments. For example, you want to try some interesting new feature, and you don't want to solve it for a customer, or you don't want to publish it into production. So you have you need them to have a place where you can put your court, you want to save it, and then if everything is okay, you can fix it or finish this work and then pulls to production. But portion control system should allow you to have such a place, such possibility and the last one. It's a branch branch of statues, so you can create different hopes, different versions off your court in different branches and work on branch you need. And in Santa can march everything together and have won the final version off your court motion control systems. They were created many, many used to go, I guess when we just started programming and we can talk about them in two options. House a working visit your files that to pop or strategists off organizing abortion control system. It's orc modify, unlock strategy and copy. Modify marriage strategy and something between something combined of the strategies. It's Savannah works in this way, So in the next video we'll go talk about strategies, and I also hard works 3. Version control types: In the previous video, I mentioned two strategies. We can use its allotment if I unlock and copy modify it March. So let's take a look consists and we'll find out how it works. So we will start from or comment if I unlock strategy. So let's imagine that you have to developers. It's one maxim and and the other one is Oksana, and they're creating some program in our case that you'll write song. Right now. It's empty, and Jose can work. So, for example, a Maximus technique work on what he's going to do. He balks this file so nobody else can change this file. They can just to read the Masonic and reads the data. But she can't change it and can't update this file. So this developer, it bloggers the file. And then he created the first version over them file. So he I hear, created two lines Reliance off court and after says he wants to move these changes to the Serra andare get. Is this sunk text When he moves, it'd this oppression it calls commit. So he committed his changes to the version on the server. It's of a song. Text Onda After that he can remove blocking and other people can update or change their version. So in our case, excited developer, she can get data right now or she even can't get some notifications that this file was updated and unblocked. And right now she can start work on this file. So what? She has to do the 1st 1 she she should update her local copier. It this oppression because update or pool. So she needs. She has to pull the rights version off the court and then the chick compared to be your own end of date, if it's possible. So she updates. The local copy gets data from the center, and after that she blocks the file and updating her local version, adding two new lions. And right now nobody else can work. Disease. Sarah Corporan Because it's blocked, it's look by Oksana and the just these developer can update it. So she updated this version and and she has to commit the latest changes to thes server File Song 60. And she makes commit, and after that updated version is on the Sarah. And when she pushed his changes committed, she can unlock this file and everybody else or another developer can read this data and modified because previously they could just read data without updating or modifying. This changes another strategy. It's copy. Modify. Marsh is a bit more complex, but it's mostly used right now. So Heart works the check because the same program, it's our song and we have to developers. So they developing their over inversions off the Sonic or some parts of the sons can. For example, that Maxim. He first finished his work and decided to commit changes. So he he makes a push to the server and the Serra comparison first versions off the file. In the beginning, the version of song that's called Version Zero. It was empty file and his fire was empty to it compares that versions where the same and tries to Bush changes Sarah. Except these changes and because the latest version of the song In On the Server After That Exile tries to push here changes to the Serra. But what we have she started from the empty file, and Sarah was already not empty. It was for us, changes through Maxim, and when she tries to push, is to hear changes to Sarah there's a conflict because here she started from version zero. But on the server was version one. It was abortion, which Maxim did. And we have a conflict. In this case, we need the result of conflict. We will talk about conflict result in greater But right now we have such situation. So how can we can registration? It looks like this one option. So previously what we had before what Oxana had before it was empty file was was here empty file, then version for the server and what she has on her all in motion after that, when she will resolve conflicts. After that, she have to resort conflicts and push updated version to the server. In this strategy, nobody can books and file So anyone developer can work with this file and updated. But in case they will have some conflict, they should resolve these conflicts and then push the latest version. For example, she can update in cases if resist, to develop its implemented the same functionality or the same implementation Exxon a result and she tries to resolve conflict. She can remove her own changes or maxims changes and leaves The last one grocery which works or just take some part off his implementation and and they part from her own implementation and then push the latest version to the several. Also, when we talk about version control system, we can talk House A, handles history and work for his file. So in this case, we have two options. Is centralized and distributed version control systems. So let's take a look on centralized devotion control system. So advocates. Because a server with Repository, which says the whole history off our changes, who did change when it was changed and some comments what was changed. And we have a different workstations, its computers, father developers. In our case, we have three different developers who is pretty different computers on these computers we have working copy is just a file copy. We do not know who did this changes or any changes, what was change and when On when we want update version, we just commit to the Serra Serra saves. The history who changed and watch it was was changed, and if we need to get let the data we update from the server, it's pretty simple. But what is disadvantages? He suppose that the hostess The whole history is saved on one server. And we need to create some big cops to save these seven, because in emergency case, or if if something will happen in the center, it can, everything can be lost. And another emotion is distributed version control system. It has the same several with the whole history, but in the same same time, we have developers and each developer on his workstation. It has a copy off repository. So, you know, in case if I'm developer number one, I hear my working copy and I have repository off the whole application. And when I do something, I need to come into my changes to this my local or predatory. And after that, I can synchronize it to visit several repository. Yes, there may be some conflicts. I will resolve conflicts, but after that all my changes, they will be pulls to the server. What's the benefit of this approach? That Egypt developer, it has his own copy off the repository. And here she knows what was changed to where I was change and by who. And after that, when we implemented some changes to become synchronizes off a local version with several Russian off repository. And sometimes if something will happen with this supper, we can get the data and the last version from any off computer carrying over network. We can call it this way and absolutely works fine. 4. Why Git: in this video, we will talk why we decided to use get us our man version control system. And why is it so popular? Get was created approximately 15 years ago in Train 2005 by Lena store or team Startled. It's the man who created the Linux kernel. It was created to replace a previous version off Personal assistant was Beat Keeper, and now it's very popular and World Northern border control system. So what is get get? Usually it's very simple system based on a comment line interface and whites of pop. Or so here we can see the law goes off cos which using these system on the very popular but insists the great the famous companies. So also, it's open source absolutely open source open source system, which is distributed to our Gazette GMU license, and you can use it. Also, if we take a look on the stack over for survey its 2018 we can see that almost 90% off developers they're using get it's really big number Previously wasa subversion. But now it's not so popular. So let's take a look. Why get is so good? For example, if the open benchmark scanned Competitive with s man. We can see that it's faster in some cases faster in 50 times, for example, for a walk common and compare for commit and therefore dif for look. It works much, much faster, and the here you can see the difference in seconds. Also having Harburg. It works. These are far to regenerate is secure hash algorithm wanted. It's, ah, talking and get to take the for air fire. And even if one bit is different, it will generate a new version off this file. So it's very secure and it's almost impossible to some piece of your data. That's why it's very proper and very secure, also is very. It's very easy work with branches in your get register. It's almost free, free, based on space and time, so you easily can create different number or for branches and work with them as you want 5. Download, install and configure: in this year. I also hard to install. Get on your computer. In this case, I will install it on my Mark O s and four and I will show you how to install it on leanings . Insulation for in windows is the same. Also install for Marco's. So let's go toe the man. Get the site is to get a c m Good. Come on down. The main patriot will see the bottle for download Get so let's cricket. And after that real downloaded it redirected to some source force site and after that you can download you can download your So asked what the latest version or forget? Okay, let's open it and install this baggage. That's okay, So lesson lesson still it is open installer and open. And now what? Realistically continue. Continue on Garrison will be on the fault. My name. Okay, so every single successful that's close it more to thresh. Okay. And now we can open all the terminal and the check Golson. So this is It is the latest version to 23. So that's install eat on the lee looks So for these really use Google platform here I created get instance it's a little motion instance. Compute engine. So let's connect. It's just a smallest F one. Micro senator is allowed to firewall settles for a stripy Inish Spears. So I think so. Let's open it. Okay, we're here. It's a debian. Would you be hell yes, they be unlikely. Just First of all, it's updated. And after that, install git. Just get install Git. Yes, that's created and the Czech conversions get version. It's the same not the latest, but it's a game. So that's, uh, what's important in getting selection that you don't need any dependencies. Forget it. Needed stole Java to decay or any global variables you just stole, get and everything works from the box. The next one. What I want to show its smallest configuration that's generated small ssh key, which we're going to use on our represent 30 servers. In our case, it will begin top. So again, let's goto our council and other computer. It's cleared and the generate Ssh! Kim for this one for directory use Cesky Jim. It's installed on my card links, and if you are using the Queen does it will be installed. His get the same time as a type. I said there say and US comment. It will be my email. My old email. Yes, so it seems. Should be upper case here it the here we can see the past. We're going to say off while it will look for this folder. Just go change it. Beat the name because I have already is this foil. So let's carpet on Bond, I said, Get basic. Here we need it is the best one pass phrase I can lead empty, but you can add something simple because it's going to use it when you're going toe like in tow the system. I will put it the same. It's empty and here we have this file. So that's go to this folder and check would do the hell. So let's go to assists sake. Here we have this. Well, so here we have a public Kim is get help basic public and ever private killed. Let's check what's inside. So here you can see that Private Kim never draught shares is file anybody. It should be on your computer, but you can share a public here. Let's take a look on public him. It's our public e and in san to become our comment. It's our email. So right now what we need to we need the ads is probably key to our get Harper per story. Okay, I'm on Get top repository. You can go to second Exp age. It's settles and they hear received which we have a cessation and and other keys the and let's add the new a sage team title. Real being it basic on Dhere, we need to put over Ssh, Keum, that's got being is a whole stream Chris comment and save. So here we can see the trick. Our first key Enza we can use you this kid will use for subscription all commit. We're going to push disease, get hops over the next one. What were the next one of what we need to configure its configure user name and email on Get So let's go again to our console. That's cause it go to home. So we need to put user name and email to identify usual who pushed some comments. So how can we do it? We can satcoms like it. It Conficker is for global interview before all repositories in your computer. If you want to use for your local repository or just for one repository, you can configure it in another way. It's not the global to the local and said the user name We consent and also to do the same for email. It's my old email again, and now we can check what we set by. Call it the same result parameter. So let's check our email. Yes, it's what to expect and all the name name is the same. So we finished configuring getting on our local machine in the same time we can do the same configuration on Lenox error. So here in means we can check global configuration, and now it's empty so you can configure it by yourself. We're going to use this sever. So how get worse from different computers you can use any separate mitt might be or local computer might be who go out with form Sarah or or a double. You see him Doesn't matter. Just great answer what you want 6. Create a GitHub repo and clone it: in this video, I will show how to create the remote it harp repository and how we can connect it. Fetched data or whose data to this repository. So what we need to start Let's go to get help that come, main based repository, it's I need or sign up. And on the main page, we have bottle new. That's click it on the here we can create our first proposed repository. Um, I'll add name GID Emma, so we can do it. You go get basic. So yes, it's a unique repository. Um, so we will catch it public. Also, we can create private and nobody else can use it if you don't provide access to CIA suppositories. But privatise key on also, I would check check this checkbooks initialized this rapper with the read me, um, it means it will create. First committee is reading the file, and it's done just for simplifies his demo because first committee will be added. And then I so hard toe pulls his data from the server. So let's check it and the create repository. So here we have our get basic repository is created because one commit because read me file with this wine, and right now we need clones, this repository to our local machine. So let's go to court and download and the here we can use Ssh because they already created is this H gear? Let's copy carpet and let's go toe our council and go to the folder where we're going to use. We're going to put this repository. So in other computer, that's copy. Paises Comment is just Ural, but it doesn't work what we need. You need their common get clogged on this blind squeak it. So according so right now we have a problem. His connection to our preparatory because off aboriginal rights a sausage key, we set another name, not the I d ever say what is default? So to solve this problem when you just add this key toe of a key store that's called Government as a stage ed and adds these get basic name well, radium direction before. So that's court. It mentioned it. It's added on, and now let's go to our folder. But first, for less check if it works, let's call common sense a shooting, getting it helped that come and here we will see that high us successfully notarized, authenticated. So airship works great so that we can go to the folder where we're going to say our ah, over repository, a local airport. Storia. So let's cleared and okay and let's go to our get basically poster and again a school copier as in stage and call. Get goal now obviously that everything is okay, Let's check our folder. We can't get basic. Let's go to the basic check. So he recovered me. We can open it basic at its OK, it works for that check. Is it our posture? Let's call comin to get remote with the variables back and here we can see that we have a region its top so actually works flight. Right now you can check starters off the state. Why we get her proposed during We see that to be on on Master Branch. And it's lucky. So right now we can add some fat file and check was going on. That's touch. So do you extreme. Let's check. Start this again. So right now we see that you have some new file on tractor and we don't know what to do with this file and get her command sick at this file. But first of all, that's at some tax here. This at a first line off song. Let's say it. And right now we can add this file. So let's call, get ad and file name check against daughters. So now we see that it's a new file, son 60 and get get recommends to restore stages stage to remove all changes. But we don't need to do it. We want to commit this file and push it to Sarah. So let's go meet our changes. So that's called it. Commit his comment at it. Sock txt has committed. So against daughters. We see that there's not absolutely committed but you we will open our target repository will see that nothing happens here. It's because we need to push. I would change toe remote center means in her nice our positive, local and remote right now as check our look neat. Okay, we will see that right now we have to commit the 1st 1 It was created when we create it depositor and added Really me. This in your shock initial commit was created by another my email and to be added sock text you right now we need a pushover changes. So let's call get. And here Arctic is pushed. Let's check what's going on. The server on the human receiver to be here. One file. Okay, so it works. If you can see it's what to be expected. So right now I will show you one more option how we can go on a repository. Previously we used s a sage and because we created Cesky on our computer. But we have also Lee look server without ssh key. We didn't add it yet, so we can use https option A Surrey created public atop repository. We don't meet after rise or some Do something Click it so we can just copious s age that's and go toe off the server and the gold deposit er in our Sara a check where we are It's it's empty. Home folder. Let's get gone. So this is that it's done its success of the court we don't need at the password Gilligan or even a sous h g of the check would be here because get basic. Let's go to this folder and we consider to be care all the same files way can call repository without generating a sage key. But in our case, it's a public repository and it works fine. Respublika repository 7. Pull from remote: in this video, I will show you how to pull data from the cellar. So let's imagine that somebody else from your team did some implementation. Some changes pushed through the server. And now you need to get his data for your local repository and synchronize your changes is he's so right now for damage. People open on a sortie extreme. And here in guitar, Weaken added this file. So was go to add it and at the another line off of a song. So let's add one new line and they hear we needed left comment. Comey changes its what to be changed, and they use the email. Right now it's Zeze one, and now we can't commit over changes immediate. And when we go to the basic male age, we see that here we have three commits. Let's go to our depository local poster and they check it look. And the here we consider to be, have just do commit and it's okay to because we didn't see her. Nice are repositories. So we have three commits on remote repository and git hop and just to commits here locally . So in get heart disease a common to each cause Get factual. It's real centralized repositories, but it will synchronize just branches and tax. And it Well, no change content off your files to do it is a is a common get merch, but we can simplify our work and combines is to commerce. Is one comment it calls Get pool. So that's gon get full and we'll pull data from a remote repository. That's good. And here we can see that was changed. One file sonic txt and sub schools added. So we can opens his file and see what it was and is there. And now you can see that we have one more. Why So I added, Does this file? Andi, if it get Look, we see that we have this comment in this committed added new line, and it was added by Maxim. So we have all synchronized files in our local repository 8. Git GUI and gitk: in this video, I will show you how we can use the graphical user interface visited so previously. All in all, our witness. We used the common 12 and it's not the best solution when you're working with is a huge project with ah, lot of files and a lot of changes. It's a give and you have one fire. You eat the change stops, add something or update some small wiles on a small piece. Information for larger projects. We need to use graphical user interface or some of us have to use it because it simplify our work and especially for beginners, graphical user interfaces. Good solution. So today I will show you how can we use graphical user interface from the books? What is is karmically is a get so let's start is so I say mentioned the graphical user interface. Real simplify our work so and get these and get here and I will start with our percentage if you'll start on a new process and we can work in our council and at the same time in these graphical interfaces that started, so here it. So it's all a graphic graphical user interface. It looks pretty simple without any think features on Duh. It's okay right now. So what do we can see here here? Right way? Don't see it. Almost Anderson. So let's do some small changes that's added off a song. Txt file. So let's go and add some new file. No. One, you will save it. And right now, let's check in our go us quick risk on button. And now what can you see? This is that because this file it was modified solid 60. We see that green green collar. It's obstacles added So in your life was added and we can check your something was do it. Let's do it again And it was really salty. Open could agree again. Risk are. And now we can see that rat. It was what deleted and green, what was added. So right now it's on stage changes and we can commit. This changes toe our get repository. So let's do it to do it. We need the click on its icon not the next, not the file name. It doesn't work quick, Aiken. We clicked and then now we see that this is changes are staged on right now, we can add. Some commit, and there are so that we can commit. And, of course, we need to push to our server. So here we continue its master remote, and that's push. So it's a real radical figured as the stage Keach. It works fine and yes, successful. That's jacket on. All get heart proposed during. So here we I get How preposterous is that? We have four commit That's open and now this is is added new life. So everything was changed and it was pushed. It works. It works as we expected. Also, what can we do? What's going on your, for example, we will change to file. So let's added this one again. That's Ramo. This and, uh, you're dead. Read me So again, that's open. Goglia. That's a risk. Our andan, obviously, that we have to change, is it? Read me file. Gail. Something was deleted that was added, and in the the exterior inside 60 so we can push with just one file or two files just added , or click again removed so we can push its push them together. Commit on after that Push to Sarah in case if you're using a girl is essentially with the past. Froese is here. You will need toe enter your pass phrase. They're bass work and that's bullshit. So it was pushed it. So everything works. Fight another two. I feel sure it's get K Gates Seymour to it's Coming from the Box is get it looks like it g . So all these comments that we start from the git repository started on the here. What can we seem? This toll shows history off changes. We can see that here we have all commits because its initial commit at Sonic and the added new ones lost to committee did. Right now Newam dates. So here we can see that all reversion new version difference and the show what was changed and disease still is coming from the book. But what I want mentioned that usually we don't to use these tools because they looks like thesis parter here is not think almost so. There are a few batter toes, so let's open get goose clients and they hear these for that also stree So street, I guess most pop war I know too, because I heard a lot off people music it so you can open it and the here you will see averaging is the same, but it works much, much better. Looks better, at least for me and other developers. On day. You can see the history off your changes. All files with a shift in the absence. What you need to work with your git repository so you can take a look on the's application or you can choose something tells the lot off interesting tools Another one would take a commander. It's using two great it degrading heat. In your idea, for example, I'm using Collapse Storm. It's a lot of years. Our music it and get is integrated here and version control and I can use it in the same way it sees all commenced. I see what was changed. They can check the difference. Or, you know, I guess it was at it. It's chick here. I can see what was changed. It was before what was after difference. I can see commit. And also here we can see we have or go changes. What does she actually walk? Also we can do all operation. We see who did this operations we can filter. You can choose a branch. So actually disintegrated here. Usually it's a much better and it's easier to award because here you can see all your changes that your fire, what you did and then you can check the previous history, and I recommend to take a look on this approach to thank you for watching convicted. 9. Inside .git folder: in this video, we will take a look inside to get folder, and they will find out how it works from insight so intricate Absent is built based on the graphs, and there are three main parts. It's commit tree and blob. And right now you will check how the works and would How can we get information for overseas data? So let's go to our repository. So that's not not get folder, you know, check what is inside. The other predator is just two files, but get it's a hidden folder because it starts from dog so we can trust the syndicate. And right now we see that we are in the get folder that check what we have inside. So in our case, we have a couple folders. Its hooks, for example, looks grafts on da A few files like had end index. Okay, let's go to head and the jack would we have inside. So that is not a directory so we can get head So in head is the final. We have ah link reference to refs heads monster so we can go inside. Refs see dear graphs and here we have three folders. It's Fats remote and text. So in every case we can go toe cats. Master, let's go toe heads. And here we care one master file In this monster file, we can see that these share one function talking and let's take a look. What does it mean? It's open your depth again. We are in our repository. Let's call, get look and he receives his lost commute and in on the case in head. We have reference to the same lost committee because we have so you can see Theis numbers. They're all the same is the last committee also has Go backer Also Because here Remotes folder, let's go Toe, Let's go to Remote And here we have origin. Let's open it. It's a folder and here we have two files again so we can check head it again. Silly in tow. Origin monster. Let's check muster and in master because the same elite, because of the same commit us to be already fetch data. Pull data from Sarah and re synchronized our local and remote repositories because this leads for the same commit Yes, yes, it's the same committee. So Okay, let's go to out there. Here we have also index. So in Texas. Gassama Buying your information What is certain in index when we add some file to get is common. Get add. It saves his data in this temporary index folder, and Valerie will commit that you re real committed. It will add store, get storage in objects, for example, so we don't need and what is the most interesting for us right now, it's Objects folder, Let's Go Toe objects and the Here is Is that the auto for folders and let's find out how it works. But first of all, we need a bit story so it works with they commit three and file so we can commit with your offers to a tree and treacle. Rappers toe Fire Ram. It's a sort song 60 and the blob blue pits by a very large object, and it is blocked with savor all data from system from this file and for example, if we have a few different different community, we have the same file with that same changes we can the rappers to the same boob Ondo duplicated and not create a copy. Um, stay Coke, for example, on this committee, riel, get inside the first committee and were for not what is what's inside. So because he's committed and that's that's called Get the show with like, ass and bread dear. And we need the enters. He's committed talking, but we don't need copy the whole street. We can just start typing, for example. Five electricity will be fine on the So here we can see you can get a bit more information so we see that it's commit this commute. We can see the tree. It was saved in which tree reference This is a parent author and commit ER and also diseases Coleman to be added. So that's going size history. And to take a look, Words What's there so we can call Get the the last dream and the same. We need to enter fi thirst fireable addresses and hear us. You can see we have blob, which rappers toe these two files. It's read me and sonic txt and this idea to get the content off this book because, uh, call common, get true and and you can add again five first letters off these talking it will be and the inside it's inside this bloke, we can find the content off our file. It's a This is while name and inside this ball we can see this content so well. Seven. Get okay, let's take a look. Objects again. We are Objects Folder and what do we have here we have? Because this pope and the first toe that the first of symbols in the in the committee toca It's a neighbor folder, so gets tries to save a place in the file system. And those two letters. It's a folder name and other Gladys. It's a file name, so let's take a look what we have. Create 70. Here is this folder Let's go toe 17 and what's inside and inside. We have won. The fire is CEO. Yes, it's what we needed and let's open it. And here we see that here's some Byner information we can untreated, but for his purpose, we have get so function. It's so common to each we'll show what's insight and inside is this binary file and reads what we can find on get folder. Eso it? What's interesting that usually we don't work with these get holders and the objects you don't don't need it actually have a bike. It But in case if you will break something, busies folders, for example, named or deleted. It's very, very difficult toe. Fix the problem, and usually you need just doing this. Repository and corn from remote sever cause remote repository and start everything again. It will be the simplest function. 10. Undoing changes: in this video, I will show you how can we undo some changes or revert changes we did before? So how can we do it? To understand how we can river change, we need to find out where we are and the best in this information. We can do different steps. For example, we can implement changes on the file system level. Or we already additives these changes to stage and can ready to commit. Or we even committed file and bet on this information. We need the different steps we need to do different steps. Toe reworked our changes. So that's time from the first version. It's file system changers. So we just add Add some file ordered judged already created file and we didn't communities fired, didn't added to staging area just to one toe. Remove these changes. Yes, we can just copy is appears version and then did mentally. But what we're going to do in case if we have a few files, it's difficult to handle a lot of files for working with fire safety. We have a common D check out is the file name can pass a file name. Let's try it. So that's open all repository A And here we have two files that's added both of them and the check What the gill get will show us. So we added these more control X you save and, uh, added Read me also control X yes, save. So now that's a check. What do we have? It's a get status right now. We see that we have to money five files. It's read me and sand and they get suggest to Commons. Used to get ad file to update what we go be committed. It's they had to stage or we can get restore and to find them to discard changes. In this case, this got this common to really remove these changes. But let's try do it with the ditch cards they used to come and get you got to be checked. Orel already. Um, okay, let's try get card and the file name minus minus and son takes dif example. That's code and again with school, get status. So now we can see that we have just one file modified its read me and what's right. Let's take a look on sunk X If I what is there and here we see is that we don't have reels like we don't have previous changes, so everything was deleted and it means a fuse. Undo some changes. Remove them. You can't go back. So in get action. Quote you already deleted is deleted. It's okay. And right now let's try toe Revert. All changes in all files, for example, added again, these file. Save it again. Get status. We have to modify it files and let's revert all files, for example, because a couple folders in each folder, we have a lot of files and we won't revert the Everson. So in this case, we can call get card dot, dot means all fires and all directory in this directory below. So Aris's group restored. So we see that undated to pass and get status shows that don't know any changes. And we can check. Read me and we see that these mo change Let's go back, Okay? It works fine with the fire, so we already were created before and modified. But let's imagine we create a couple off in your files. It's cleared. Let's touch for the report Dog Eakes and the Dutch and some excel, and right now we call get status. We see that. Do we have two new files and gets the just adjusted to add to this fund because there were no such files before and the man in a previous version. So if right now we will try toe get God called report, for example, we can see that this file doesn't have a previous version and we can't we can't revert because here we can see that it didn't match any files known to get So Geeta does know that about this file. So how can we remove it for these? We have. We can get clean common to Kabul flags the three of them were going to use. Today. It's X. It means ignore every ignore rules from getting Norfolk while we'll talk about it later. D It's a directory. It means the folders move folders and there's what was inside and after its force we need their cause is common to change. Toe applies his changes. Okay, so that's Ah, let's go get clean for that without F and we see that it require force. We can change these configuration, but we are not going to do we just call it to his F and he receives that too far. So were removed. And if we call, get status, we see that everything is fine and no files and three is clean. And the next one, what we're going to do. It's for example, we already added to do staging. So we are ready to commit this file. That's add it again. That said, Teoh its status. So because this modified file and we need at it to staging, that's called, for example, get Julia to try do it in thes. Okay, let's start right here. That's Paris con, and we see that because this one while on that's added toe stage. So here we can cause it and get status. So way see that disease fire is modified. So let's try toe because these files of Let's Go get Gold Crowd and the song D extreme on git status. So we see that nothing was changed. It's still modified, so to revert the change, we need to remove it from index from stage and carrier toe file system, and then we can do it in a file system. So to do it, we can call common, get reset two franks and two minuses and against on XDM. So this is a unstaged changes and get stages we get here. One just modified files called Red, and now we can call each card. It's state off and we see that is clean and we have changes. And if you will open this file again, we see that to be having more changes are gay. Let's clean it and the the sort option when we already committed this file. So here we can use get through Saturday's head to our character. And here, number or card carries its means. How many commission you need to go back or if it is not, But it is very big, huge. We can use the number. So that took a meat behind and the articles waas what Waas committed before we'll be. I'm committed or we can do another option. It's committees, Armand meant. So what does it mean? For example, you committed some file some files and these committees more or less. OK, but you need the changes unit update this commit. So in this case, we can don't remove it, we can just add it is commit and Lee would become so let's try to do it. So that's, uh, check stages and get along. So right now we have Ah, February 19 Lost commit, you update. So let's try toe. Great. Let's try to update these commit so well. You changed one a while again, your line saved and let's open. Get going to so high doors from your perspective. So and here because he's one. The new line we can add toe stage area and the here this radio button we can new commit or comment lost, commit. Let's change toe mental last commit and in stage area receives that in the last committee we had two files. We had updated two files committed. Andi. Now we see that new updated its the last commit message become at at something like at your line today so and committed. So right now we can, uh, check or get Look, And this is that because this new messages added new wine today and this committee was implemented February 19 Waas. Yesterday. We did these changes today, but committee is from yesterday. It's what we expect and kids status. We just is it to become one different from remote Sarah. But it's a k everything locally is updated, but that's a matter to be committed. This fire. And we won't reverse this change because it's not what we expected. A man comment. It's a great comment and, for example, I use it almost every day. I guess every day to Bush to match request one, commit just you talk about letter, but want to we're going to Do they want to remove the whole match? Request the whole committee. So in this case, that's call. Get every set. I had a and, for example, one. Get it. So on stage changes to see that get status. This is it. Right now we have modified to files. It's from last commit and if you call, get work, we will see that we do not have the previous commit before and we don't have commit to be implemented yesterday. Committed is a man fact. Today we have just too much if I'd files and, for example, these files already in file system, the previous coming towards remote and we can deliver this fire or at staging. So that's Chick Bruce kept on, and we can add a while to stage read again, get status. And here is is that war while is modify it and another one is already added to stage. So in case you call get Chicago dot It was easy to be just one modified files, but we don't have already. Don't have read me. That's skin. You see that? You just read my file. Now you know, a few ways we can reflect commit. So it's very important because in gate, one of the most popular question is, how can I reward my last commit or how can I undo our commitment? My last commit because really something can we want throughout it. And so right now you know how to do it. 11. Git reset: in the previous video. How we can reset changes and undo anything what we did in our system. We committed it and saved to get on. And in this video we will go deeper toe, get reset command and to find out how it works and how can we use it? Indeed, to recover three levels off for saving data it's a final system. Just added this file to the system. Then we can add this fire toe index or staging area. We need to call common get Ed, and after that, we can commit this file of is the common to get commit. So we're moving our fired changes from one level to another. One is common. Get reset because moves these changes back to the index and file system level, so get reset. Has a couple of fox salt is a safe, safest flock to move, so your changes from commit to index and it's the best way. If you do not want to lose something by default, get reset works with mixed flag and it most directly to file system, and the your file will be untracked. Forget and disease. Flag heart. Beatrice at heart. It deletes your changes completely. So be careful with this common, because in case you lose it, it really ability or changes your files and you can't restore it. Let's go to our ghetto and try to change something. So, you know, ghetto, let's check. Get status way. Have one modified file it's get and it and it commit. And my right and the message. The letters read me. So check it state of So right now we have nothing can, uh, steak. Look what we have said. It are salty. Extreme. Don't miss our 60. And so we added one final that saved. And for example, check it staters again. It's much if I class added and commit. So now we committed. We can check it status again. It's fine. That's clear it. And let's try toe get reset Soft heart works. So we call, get reset. Zach Soft and said, say how many committee one back it will be had had, uh, filled up what? We will go welcoming back and get status. So we see that because his son 60 file were changed before and it's modified. That's check was inside, so everything is inside. We see that the new line and a new partners. This, Sarkis added, Get you open. Get Goglia. That's Paris. Can we see that this fire is already in stage changes and we can see this new part or to be added so and again we can We can commute this foil, let's committed and that shake it look so we can see that to be have added new line again. And it was the last commit also forget. Look, I wish I was once more comment. It's get locally the flag breach here. One line in this case we consider to be here all commits in one line we know based off ahead on the last committee really used later. Okay? And like mixed is what we have by default. So let's try toe get her set mixed. And I had, uh, the same character one coming back and we see that unstaged changes its song exteriors. Check this file. It's a get state off. This one is my defied on gazing open. Get your skin again. We see that this file with the same changes its unstaged and we come get so the exterior is the same file on with the same change. Also, if you need remove it, took and get called or asked the question yet. But again that's committed. Commit so its status. So as you see, we cannot commit because we didn't add it. So don't forget to get ad on. Duh. Get stayed off. Like right now we can commit. It's fine, so that's clear. And right now we will cast Getter, said Harp. Get Hook one line because his new commit Let's called it who set hair and go one while coming back. Now you chose that head is snow at a 704 It's this one. It's this one. Shea one Commute Koken idea. Andalus, check again. Look creature. So we have a nose appears commit. Get status. We have no changes and check us l song. Txt. Let's check what we have inside so we can see that just new line and we have a know all the latest changes. Everything was removed and we have just previous version. So if you need to delete, your committee can use this common. But be careful. It's pretty, it's It may be dangerous 12. Git revert: from the previous video. We know how Toe River changes from our local commit very change something edited to index and then made a commit. But is this video of able covers lost part from Roberto joke changers? It's how we can reveal changes from remote repository. So let's imagine to be committed it and pushed subject to the server, and we want to revert it and undo these changes. So let's create changes again. Let's add it over SAARC ticks team so we can add the new line and give you add some something like a Coleman. What we need to her about. That said, Let's check. Yes, it's money fight. Let's get you commit, get status So everything is OK and now we can push to Sarah get pulled. So we have rejected because some changes on Senator So that's called get who gets the latest data from the server. Okay, we need to result conclude, but right now we don't have time for for it. Let's just reset of a chin. Just had, um, let's go free commits back it status on does get. She called. It's State just so you will check. And right now let's try to get full latest data. So now, because a date lotion from the server and right now that's cleared and again it's modify ourselves. Other file. So that's cold. Laura Song, D exterior And it'll add sounds iniquity want to devote said Get at Harrison. Get meet. It's they just think it's OK. So obviously actually was pushed under to check it and be sure it's open. Our file are Get top repository. Let's open it and we see that sun 60 was updated 27 seconds ago. Let's go so we seizes change and also we can see him come meet what was added. You can see parent what it was before, and right now we want to reward it. So how can we do it? Let's go again on defiance. This committee it was made in this commit So vineyards is Shay one token. We got a copy to here Or get work. Great deal. Well, what? Andi is the same. A token is here, so that's called it about on disease. Commit only contract type does feels five letters. It's OK, so and now was going on. Get open Text editor Real and it's really very very old editor. It was in UNIX. Andean Lino sends and in get and the here we can add it our commit, commit message and what we're going to do. So here mentions that we reward new commit and these reverse committed on. This is a one talker off this commit and what are think everything houses commanded text and it won't be in Europe Commit so you can add it. Add it here. That's as something So it's Ah, we editor. And to start added editing, you showed the quick insert Barton on your keyboard. In case if you have a MacBook or you have is this keeper, you can click. You can press I Q. Bert and then humor in the bottom of the Korea was, Is it insult is insert mode, and now we can add something on that's type. We're abort this commit, and now we can stop editing. So to stop pageant editing, you need to press escape bottom. Here. You can see that we have no this Mort, and after that you need press. You need to press corps here In the bottom, you can see and two letters. It's w Q. Dalits right and they queue. It's quit and curious. Quit and less press enter. So now we left to the center. That's check it status less and get Look on day. We see here on the Toby comment. We have a commit revert new commit on and it reverses commit So how it works it just creating a mirror. Commit and reward. Ashton, could you do in another way? So it adds, are think what you deleted and deletes everything. What? You add it. So that's push it. Let's go get So now it's pushed and let's go back. Open up the son of Dixie So we see that we have no such changes. We have lost, committed and in this last committee received that this line was Do eat it and let's go to the parent. And in parent it was added. So this coming just deleted EarthLink what you did in your committee, but the benefit that you have history off all your changes. So you know when we want something to eat and toward something reported. What is the advantage of this approach is the same. You have a history off all the changes. So in case you push some passwords or pinnacles or some security price information. It will be saved in history because rewarded. But we'll talk about in the end of the scores. So the next war, what is very to think about? Disease features that get your reporting? It's commit and you can revolt. Rewards commit so that's clear it. And again it's open our lost commit. So is this one and we can't revert this commit again. So let's call, get have first fired electricity, is I even? But not enough what I'm doing. Okay. And we're again in We so right now we don't know toe want at a text. You can just press escape, Onda, Um I call on you And if you don't want right, some just leaves his editor You can rescue and exclamation mark and are the seat. Check it or three d 11 So right now we see that we have new commit It's our local head here and we can see that origins master and origin happy are still here because we didn't push our changes. So that's again get pushed. We'll push for changes to this remote for our remote Sarah, that's check it so and again we seizes lights. Ashiq was rewarded. Watch it again. So let's go to this. Commit. We see that it was added one band. It was deleted. So it really they work on this committee. We can see that Vortgyn new commit and arsenic works Fine. So don't afraid. Revert your changes. Because all this you can record your resort and actually will be saved and works fine. Thank you per fortunate. 13. File .gitignore: Let's talk today about get ignore. What is it? How can you use this feature over Get so But also you need to save everything can get. Sometimes you have some looks or build the results or even some unit tests Good coverage files and we don't need toe. Save it to get because all this data's air generated during work and we're doing save it. So how can you be here? Prevent adding it to get and push into repository. So for this we have get ignore file This is just simple file. You can create it with the DOT first Erica is the dot because it should be hidden. And when you created all file names or in place of his name, you will put your father will be hidden from get and they wouldn't be added. So how can we add these files so they some mask or template off files, For example, when we create with Asterix, don't look, It means that all files is the names with any name. And if I was any name with extension, look will be excluded from get the same time we want at something cough it, we can use it with them. We can use this to try to prevent removing from get. Also we can delete, began room from gets a whole folder or or some folder. So let's try to do it. So in our gate, we have because to fire send to get status, everything is okay, So let's create this file and ah, but that's Grace on the log file. Just a test local. So because these files get Signori's heat and so we can see it here. So if we call get status, you'll see that we have two new files is to get ignore and the lock ignore. And if we will open our we get good. Re scandalous is that we have to this fast and both of them are empty. Um, so how can we hide this look while So let's add it, get ignore and the here you address to look work while that saved said and now get status. So right now we see that we have just get ignore file that's open go again as very scared and we have again it ignore with this file. So in case you add the new file that file log so we see that because this fire game, because it's a lot. But it z another name, Let's add it. All right, get digging are and real changes is this partner. So every file is extension, what will be heated that's savored and again need state of services that recaptures one. Get ignore authors that you need to communicate, ignore and push it to your repository and every developer in your team really use these rules and all possible Big North so us imagined to be used on everyday work. For example, if, in case you're working with the Web storm, I'm working 50 for what you need, you need to add idea folder because everything which is related to the storm configuration it saves in idea folder. So you addis and remove in case you're working with job asleep and no, Jesse, you can add the murder models, the models and all they are. Normalcy will be excluded if using other language. For example, beytin. There are a lot of libraries you don't need to push. This library repository can ignore it and then just download when you install cure project 14. Branching and merge: in this video, we will talk about branches in get So what is the branch? Previously? I matches that in in a get arsenic is built using drops in grass. We have notes and the links between this note so are over. Get the structure looks the same. We have a lot off knows it's our commits and we have links to these commits So we can for that commute to be. And it was created best on the committee A So I understand how it works. Let's take a look on get was open or we get key and we will see it there. So I came and so he didn't get a We have a lava commits and there looks like notes and the Here we have a parent is Saleem Toe Parent Committee. We can go buy parent by parent and here you will see that we're moving in the beginning off our least. And in that we will get Our initial committee is no parents, just child. Usually it looks like line busy or commutes. And next limit is based on the previous war I already mentioned basically is is because we can take a look of our application and split this application into the features. So I'm application. It looks like a bunch of features, and each feature has suffered symbology. Also, you can imagine that it's like a tree intrigue here with three truck and per metre, you can create branches, each branches some of feature, you know, case from commit, be recreated New ISA functionality. It's the future small feature app. It's a new branch and then recreated from the secret me to get a new large feature with the couple commits. It's, Ah, this one new large feature and these parts that there are branches so that when we finish stuff Ancelotti or branch, we can marriage this branch e back into the tree into the trunk and each cause marriage. This case, you can see the whole life cycle off feature high. It was supplemented and how it works. So in get, we can describe two types off merging branches into the main master, the main branch. It goes master, and when we marched house into a monster, we can describe it as the two types is fast forward march and not for four, but most so That's not from this one navigating Have a hand. It's, ah point of each point ways. Our lost committee. So when we created because the beer pointer wasn't b was ahead, that we created committee and the now pointer is on the sea. Comedian on It's a Monster had the shows that this is a monster. After that, they regret the branch. Visit three new committees, some feature and in this branch have its overhead. And this had it shows to feature. And when we're going to use the fast forward marsh, we can justice into why our work and just move had from monster moving to feature. So and it looks like this one. So we just moved on ahead. And now those committees F and Arctic, What will be next? It will be a continued from the Afghan it So how can we do it? Let's go to go to our go kart. But first of all, let's take a look on Geeta because it's on the city Get And here we have had that's, uh, so in head we have a rabbit that it chose to head Master what, Right now let's create a new branch and the great branch when you call comin to get check out and, uh, boot branch name. So which a card? And so we haven't any branches to create new branch and check out in this branch, we will call with this problem to be and the name of branches you be future. So right now we're in sewage toe new branch feature, and in case you go toe get And yeah, you will see that now Reference to cat is this heads feature. So right now we switched our committee. So let's, uh, go back and and Diggle added some file So let's no, no, you have a song and they're here. We can move this one and yokel thes one also. We will get at it and they get committed officers that to be you double this operation. So it's against sunk, and it's a song on and second committee, same again. If you call, get status, it's modified. That's called get at and they get commit. But it's little bit second, so get status. Okay, let's take a look and get off. And here in a top, we can see that it's a second commit, and here we have, say, one talking so that had shows toe feature and it's talking. It's a 432 read sewage again to master. Now we switch to muscle and called and the here is is that the last commit? It's absolutely another one and they had shows to master. So how can be a marriage? Our feature into the main master branch implemented. We need to go the main feature the main branch, the branch What should be in the destination branch? So we need the marriage to branch to master. So right now we're in muscle and dinner. We need to call common get March and the best the name off Branch. We want to march into Z's branch. So let's go get merch and feature feature. It's a neighbor whole branch, so that's good. And he realizes that it's fast Forward was forward and we merged to Sonic takes team and grad school Get look so now we can see that had its A master also is a feature because the same branch and it's is committed both 32 and now muscle is updated and wants to the same head ports to the same community. Okay, so what is no fast forward March not just for a much It's a similar, but it's happening abandoned because something new in our master branch. So, for example, form see commit. We created the same a big feature, your branch. But Master waas sub supports updating and re created new commit and in this case, we can to just warranted Do these one feature because we can lose sums some important for measure in another community. So to fix this problem, we can create a new commit. And is this committee to real contain all changes from this branch and also changes from off the new commit in the master branch and you create new commit and push ourselves to this one. So let's try to do it clear in romances functionality. Right now we are must've That's cowed picture and you're great. Couple of commits here. That's at it again. What said? But Ed and, uh, welcome it in future, we can do it again. So repeated separation and, uh said so. After that we can get a look. You will see that the last committee. It's B zero c zero. What's let's go to muster branch So it must branch you, Ed you'll adds the same file. So or you can add another fire that said, uh, read me, Does that have information? Save it and to get at So we have dated, read me. And right now we want to merge our feature branch into master. So how can we do it? The same destination Brunch is the monster and social branches have a feature, so let's go get merch. Future Onda hero is what we see. It's our they must be text editor and the human need to create new committees attacks now because the four text It's North Branch feature. We're not going toe and testing. We believe it. So we quick escape colon right Q And the press After that, three sees it Marriage made by recursive and that is not forward merchant. That's Jake. Get status. Must I can get look and in get clock diseases New. Commit one BBC on DA message Merge branch feature. So we merged all changes into Masa on duh married because a final version of court in other Muslim branch and we can open. Get Kate to see how it looks. Incent. So that's called key. Andi here we can see that because such a graph we have a second committee. After that it was created was created branch and in Santa because feature and as it was, motion to the mosque. So in case he will create a new commit hero And now we see that we all commit Get ad on Big get has opened K g. And obviously that final versions mustard and we again go one by one in one line all over. Commit that all branches were behind there. Now it become because final version off our source code. 15. Conflict resolving: for his appearance. Media, we know hard to merge two different branches in tow. One main branch in orcas, its master branch and abuse. It was successfully without conflict, but sometimes it happens. That, too, because some conflicts. So to find out how to resolve these conflicts. First of all, we need Teoh learn what is a conflict. So what's conflict? Sometimes different developers editing what you find the same file in different branches. And then when we tried to march in, eat into one file into one branch. Be care, conflict, conflict because it doesn't know how to solve the difference in two files. Forget it does matter what you'd add it there, but it just know that the same file in the same place. There's some difference, and somebody should soul and decide which part which commit should be choosing. So let's simulate this case. Let's go to our sick it and we'll create two meeting to different branches, and then we'll try toe results of conflict. So we're in muster. So let's edit our song critics to file and do you add some so they save it. You'll add to get and they commit. So we commuted it. And now you see that there's doesn't that we can get called So every speech to feature and now we will added to say, fire the same. Okay, so here we see that the same changes That's Adam changes from feature, but saved. Let's add get ad and get committed. And now we go to get called muster. But I must. And now we're in destination of Branch and we need to marriage over branch feature Branch. So let's go get merge HR. So here against is it off the merchant and the conflict content Much conflict insanity extreme. So automatic merge felt get they couldn't merges is changed automatically And we needed to resolve this problem by ourselves. So some somebody should point out what version should be. Choose Jews An end to decide how to do it the jacket status and get Look. You see that here Bose files modified and in get look, we will see that almost lessons Contrition. Okay, so how can Reem results file? Let's open this file. It's extreme And hear what with him. In the beginning, we have ah, the previous abortion what was both into file. So it's the same and then because these symbols and the head had, it means that this car and branch in our case it's muster and all these symbols they're known compile ble in annual language. So you're does matter. What language are you using your ghetto? Riera I d. You know that it's some special, strange characters and it should be solved somehow. So here we have, apart from First Picture Branch and here he is from muster and each has are from Beacher Ranch. So we need to add it. We can added by man on the and we will decide which parts should be added. So it's edited. It's about you don't yet. So we decided that this version of the fashion is the final and we are happy with it. So that's saved. And now what do we need to do? It's Jack status again. So they're both modified. We need we need great commit just usual commit and census data. So let's again get add this file and get commit. I love Ocean saved a jagged state of So this is that Harrison is modified and action is successfully pushed. He successfully committed and it look, we see that this committee is the last one. This committee is the last one. And why was changed? Be sure how it works. Let's hope it's open and get game and see how it looks from usual perspective. Provisional perspective seizes Branch Final branch Here you'll see a so Jake Steve on BC's a loss changes Will was added. What was into commits. So right now we know how to result such conflicts. Let's find out how we can avoid conflict because results concludes, is not a good idea. You should try to avoid it because I know it was just one. Acquired was very simple in that we could edit it in some text editor. But sometimes there might be a lot of files, hundreds or thousands files. Or it might be some difficult files for Zeppo Microsoft to work documents, and it's very difficult to results as quickly to avoid such problem. We need great shortcomings, so don't create one big commit. It was a huge feature just to commit us. Often us. You can, and then it will be much easier toe, resulting in case if you happen. The second part is no ad. It's a white spaces ISO are non printable characters. For example, new lions, Debs or space is try to avoid it because fire is the same from Oracle perspective and from the content in the same by the venue. EDS of space or and new empty line. GTO thinks that it's a new version and there might be conflict. And also marsh often so, so far as possible, usually in our development work every morning, Agree came to work. We tried toe full latest data from the server most to our branch and, if it's possible, merged a few times doing today, because sometimes air problem can be sold or feast in another branch and as a developer, or if you have, if you change some common files, as it might be, some conflicts and the unions result us Souness possible without minimal minimum effort and also what other we can use its solving conflicts. It's first of all, you can decide abort, do not result conflict. For example. It's evening and you have a tie for result of conflict because you need choose what version you be committed. You can just abort and result this conflict on the next day. Also, sometimes you can choose just the some bridges version. For example, if you merged another branch. And you know that in this book, just branch, I think. Waske exit. You can just decide. Scout. With the X there's on your changes. You be removed and or you can use just your aversion and Harrison council do eat it so also can result manner. By Deve Dif Uh, it's not so easy. Hard oddities Museum thing is opening while an edge anybody, yourself and also you can revert changes is the get about. Also, these are immersed rules, which helps you to do it. Usually I use I result. Const. Conference in my i d. It's a storm. Ways getting is integrated and resolving conflicts. It's very, very easy with this tool. And is this it how you can result called news? Thank you for abortion. 16. Git rebase: We already know how we can merge our branch feature branch into Master Branch and finalized a solution. But sometimes it happens when we have branch created. New feature branch from master It's is from C commit and we don't don't want mercy it right now, but we want to get the of data data data. So, for example, it's Madge. Is it somewhat create a couple of commuting is very important features off mark fixes and the unities bark fixes in your branch. So and yet you are not ready to merge your branch toe master because it's not finished, but you need this changes. So how can you do it? And you don't not want the marsh most it into your branch. So you hear you can use the base. Our base works, you know, case you see that commit war. It was created from committee. So one it's a child off. See? See. Its parent said base basement off this committee using the best we can just know this pointer prophecy toe here. That's dude. So we just create a small change in history for this local each of branch. We changed the parent off this branch So right now this batch is created from E commit. So it means that you have old data for Master Bridge and now your branches, your feature branch of works. And it has a new parent branch. And it works. Very. If it was finally, if you dio change the history off Main Master Branch, so what is a golden rule off the base? So never change HEASTER in your public branches in Boston Branch. Our case. So, for example, we have most branch and were based base for muscle and then were based for a feature branch . And it means that we pushed the future bridge inside the other history. Heart can works in real life. For example, every day we deliver some task. It's Monday, Tuesday, Wednesday, Thursday and Friday, and on the Wednesday we decided to create a picture branch. It's Friday, for example. We implement some functionality, and then we pushed to history and to be changed our history. And it looks like by the Tuesday Wednesday rider we pushed to changes, which we made on Friday, and then it's again Thursday, Friday. So it's out. Good ideas off try never based for the base monster or any other Babu branches, which is used by another developer. So it was great for your local feature branches. 17. Cherry-pick: today we'll talk about one small common indicate it's cherry pick. So what is cherry pick? So that's the magic situations that you have created your feature branch from C commit and after said in Master, these developing mathematical and somebody already create a couple of additional commits in Master Branch and in one of these committees, some very important bark fix in your branch. You want disease commit with fixing this book, but it's a step games case. You don't want the whole commits, the other commits e or anything. What was traditionally That's why you can tow for the base and you are not ready to Mercure commit because you didn't finish your your orchid invention work and you just need this commit deal. So how can we do to How can we get this commit? Really, really Just copies is committed to our feature branch and use it during our branch. So carpet, because is committed it calls Cherry Peep cherry pick operation. Really, I didn't used very often in development experience, but just a couple of times I use it. So how do you know how it looks? So we just copies is de commit and added to our feature branch and that is committed has is over. And Shea one I d committed. He is the same us here. And then when you will decide to march your branch into master, the get real knows that is the same commit and it will keep any conflicts or you want results conflict since these commit So in case you need copy some commit some implementation or some fix you can use this cherry peak operation. It zee bridge is simple on, but it might be very useful for you. 18. Git tags: in this video, we will talk about get tax. How can be Who's it? How can we create it and why do we need such oceanology? So get back, Get back. It's just a highlighter. You can save her life. It's a text market, which shows some which can highlight some commit. It doesn't create another committee, just additional marker. We can create it. Visit, Get tack on version Name Onda Tech name comment and we can push it toe the server. So how can we used and why do we need it? But it's after you develop in Kosovo for and if in some period and you have final version of this date, for example, we finished Sprint and you have production Radio Ocean so you don't want toe market us. Commit because commissions touche. One name and it's difficult toe. Find out what was the last one, and it's difficult. Distinguish between other commits, so you can mark it with some name. Proper stable name for simple wars in one version two, and then you can use it for deploying your source for two production. That's great that that's Checketts State does average. Nikki's committed Onda less great commit for less great tech from this committee so we can get tech and fascinating Version one I will quote. So we created this is called Get status. So NASA was changed. And if we call common, get tech, least we will see that we have one attack and that's called get status gets. Look. And then, obviously that we call our lost commit its ahead and also because the tag version want. And now we can put push this stack toe the server squared less coal. Get right now we'll push all changes because before all commits and let's check it and we're check out, get so what? To be fair here. So we didn't get to be having all our commits and the chick here in committed with additional taboos. Tax or not, we have no tax. So let's push our tests. We need get pushed degs. That's cause this comment. And now you see that we pushed the one tech do you want? Let's refresh it. And here because this tech we want what does it mean? Also, let's create some new commute and this substance that's the matter, Ward, save it. So now we see that head is on the last commit but here because it's take one using tech one , we can use it for called example, which called to some committee. Andi, don't remember Shea one court. It's difficult to remember it, but you know the version name so you can call get caught one. So here this is a sufficient toe one. So this which toe this branch if you want until we can get switch and minus to get back. So right now we can get a look and we will see that had is all we want version So we got one step behind. Origin and master are the same the same brain so we can check out said by, say one. I commit the number or we can score by tag name So this thing suppression might be very useful if you want to mark some stable version off your court and then use it for deploying to production 19. Stashing: in this video, we will talk about Get stash. What is it? So let's registrations that you have a feature each other to shoot to implement. And they created a branch for this feature you already implemented to commits. And then you have 1000 not finished. Usually because a work in progress so you can finish work and you need this new task of the subject immediately. You have to fix in the master branch, so you need a siege to muster branch and finish this task. So how can you leave these? Ah, finished work? Working progress? You have two options. Right now you have two options. It's the merch to monster, but it's not ready yet. And you don't want oh, marriages because it isn't finished on. Also, you can check out and do it these changes. But it also is not a great solution because you already detail out of work and you don't want to lose it. So how we can do it? We can say this data to some temporary storage in Get stash. It's Is this this temporary storage? It's not a committed, not attack. It's just storage way. You can leave your temporary that relieve your changes and then go back and finish this data. So to use this, we can call common, gets their say. And as some description, also, we can get the least of the changes. So let's try to assimilate such situation. So how are we get? And let's added some while it's a just a part time job, That's that's Delius optioning. That's the matter, because when you just candles that state on also, let's create some new file that's at the so while, let's check status. So right now we have modified 70 city and added ticket next. So right now we can add this is data to stash. So that's called Get stash. Same and some description, but Kinch or finished work. So now we can see that cycle working directorial. It was saved on Muster Branch. So let's go get stages and what do we see? We don't see modified some 60 because get knows about this form and the it moves to stash. But he doesn't know interest about new file while text here. That's why I think this fire wasn't moved to stash, but the untracked files. It's not a problem for us if we want to search costs for some branch. So that's get out Feature on the Colgate stages. So we're in this fire because Samantha is untracked and it does matter. Forget and very new file. So here we can call, get least and we see that we are one name. It's not to the best name, but, uh, this is his own master. We have one stash. Also, we can great substantial in season branch. So let's first of all, let's check some kicks to you and we see that we have all all ones we added before that's edited again. It's what we had insulted in This is Branch. Let's certain and again that skull git stages this modified and get stash safe. It's the least so right now you see that we have to Parsons stash. That's switch back to master. So again, Hell's this attract fire. It least we have two options. And if you know, see it sunk Jennifer on future. So it's the solution. And not because if you obstacle, we can get this data we can call get stash Pope. It will remove data from stairs and he gets that apply it will return or changes to work in progress. But data give the safe in stash. So let's try the 2nd 1 You will need stash a point and we need past name off the stash and its dash zero. So now we see that we have modified some 60 check content And here we see another see changes from feature Branch because we we revert to changes from zero this one from zero stash in zero Stash it waas on future branch. So in case you want if in case we wanted change for a monster branch, we needed river changes for all Moustache one. And also if in if a lot of Stashes in your storage you can drop the stash and do completely so it z simple back how you can use this temporary stores and the savior data while you are work while while you're work is in progress and Eden Wood nurtured or the meat 20. Remotes: in this video, we'll take a look on concept off bolts. What is remote depositor? So very work with it usually work with two repositories is your local poster and origin repository. It's some center. Where is safety or positive copier? Right now we're using Get on, get top. But you can use it the same way with pocket or clap. It's almost the same so we can get local master and we can pull data toe original origin Sarah or remote Sarah and we can use to get fetch to get data from the center also is the same for features. When we have some future branch we can. The same is that our local future branch and pushed oh origin Feature Branch and to get fetch data from the same origin feature branch. So to add or remove remote, we can use the get remote or, if you want to view, check what we have, we can use get remote so that check out it worse in our repository. So let's open our poster and the cold get remote being so here we see that we have a repository for fashion and for pushing in the saber poster it's get on the get hub and it's okay is one of the best configuration you can have because they're sticky, said You are a poster and you portion get data from the supposed hit it hard. Truth works. So how we can do it? Can we use this remote feature? So let's imagine. Here we have our repository. It's get basic and glass image that you have lost the access to this depositor. Maybe it was a part of a team and somebody deleted you from this repository or it was your opposed. But what's the important? That you has a whole history off all commits on your local repository and they want on it your own your posters. So let's create your repository. Get down, what to It's public resolved to read me just that's created after that. Here we see that we have a sage because this is such a posture. Andi, let's go to our post story and let's do it. This one we call get remote, remove origin on. We'll check again. So now you see that we haven't remote repository on. And now we need at this repository to new new upholstery on your server to do it. Let's call get remote at origin. It's the name off the server and your l Okay, big this one copy. So that's Bush. Hold and get status because it's a modified finals. It was for the previous video. Get your remote rumbles and we have our services that links was getting basic. Right now it's get damaged toe. It's another one So and now we can push all our data with all the history to get repository . First of all, that's at changes which we have commit. Get stages. Everything gets sick and now you can get pushed so that we seize it gets shows that upstream isn't configured. Let's call this comment and it's for future branch of your future. But in case it will be a monster, here will be a monster branch that's called We see that it was pushed feature to feature and you know you and your poster. Let's open it looked. And so now you see that to be held feature branch and have 15 commits. So the whole feet the whole history Waas moved the new repository agin case me, we need a called monster. You push So this is it up? Steam for get pushed isn't configured for master. That's copy. Set it and get now. They pushed everything from masters to Sarah. And again, let's open it. We have 15 commits. That's each toe master, and we see it in most record 20 commits. It's expected behaviour and also that's cleared. And let's call get the remote so origin would do have. And this common shows this information bodies, remote repository and you can see that fashion push off. Or is this your l had branches, branches and magic is okay, so now in this So that sum it up, we know how to create to get remote. Repository. We know how to push all your history. All your poster walker posted toe to the Sara We can add or delete the poster, and we know how to get this data about the supposed 21. Branching strategies (workflows): in the future, we'll talk about the branches strategies for get and why doing it them. So branch sent receipts approach hard to you. Organize your gator branches in your project is very important. Step on a project beginning. Usually, when we start project, we decide how we are going organized. Are we get and designed best in the strategy. We can organize our work. So this will give you a cook on a couple of these strategies, the most popular. So the 1st 1 is centralized strategy to try strategy. It's very simple, stranger when you have just one branch, its master branch and all your commits are great during this branch. So, for example, because to developers Maxim and Oksana and they created commits and this game is a your master branch, So what can we use this strategy? For example, Way can use this strange when no one knows what is get and how to work with it. There are new in the Geeta and doesn't know how to work with Geeta onto his branch, or so it's okay to use one branch. Also, it's possible leave for these developers previously used another branch. Another version control system, and they don't know about branch concept. Also, it may be used if you are on some heck it on and you have no time toe. Create different branches and you need just push faster everything, and they can use one branch also. Sometimes I use this strategy when I'm creating subject for myself, and I'm the one developer on the one developer, and there's no reason to create different branches. I can rate, commit and says this committee of Olive Branch so the strategy can work for a big project. It's it might be. It will be a problem in case you will have more than one developer. So for this case, you can take coconut stratagem. It's very poor strategy, and we used the very over an end already in the previous video be discussed. This strategy, it goes future branch work for how does look so we have the same master bridge, the main branch, and for each other future, we create small branch. So, for example, becoming provide some new functionality and recreated branch for these small feature and orders at Wednesday's branch will be finished. We will marches is branch into the upstream branch In our case, it's master its source source branch and then we have another large feature. We can create another committee. We can create another branch with a lot of different companies, and when this community will be finished, real north is branching to the master. It's a real purple branch and do during my experience that we used very often. If you have a different developers and each developers should develop their own brand, there are functionality of fixed some box. So, in this case, is a good solution for using different branches. Another very popular a strategy it's they get for it was created in 2010. It's 10 years ago on the woods mute. During the strategy we have Master Branch and in this monster branch will save just production Ready Court with the text text will already described disgusted experience videos. So in mustard become court, which is published on for production, and we do to use it during development for development. We have another branches, schools develop or that branch and all the meats. Old branches will be much to these out march. During development, we can create feature branches. It's like the future Branch strategy. We create the different branches for different features. If you when we finish this future, we will notices task into the branch development. Develop branch. When your work is finished and solution is implemented, you will poor she or court to the master and it will be a production radical which will be pushed toe publish the production. Also during this approaches are some additional specific branches, released branches and the hot fixes. For example, we have someone release branch we can We can push our cord from court frees through this release bridge, maybe fix some small changes and then this branch will goto productions. Also hot fixes in Gezi in case developers or key is following some box the father box and we need to fix it as soon as possible so we can use the hot fixes branch and push this to branch and then it will go toe production. So it's very popular strategy. We use it on our projects too a couple of times, and it very good. In case you have ever size products and five developers, it's a good approach. Another one strategy will take its denigration manager work for So how does it work? Do you use this approach because different developers. Okay, so, uh, the basement of this approach is remote branches We already discussed remote. And we know that when we work with more branches weak and full data and push data from different remote servers. So this strategy is based off this approach. So become developer, different developers and is developer is over in a public developer repository and very feed it some for shalke. We push our pull off changes disease them repository, and we have integration manager. It's special Post person, which gets this pool are changes from these posters and ah result results all conflicts and do fight finalize off the court and the court is fine. Is this manager it to push pushes this court toe Last depositor last repositories a special super repository which any developers haven't access to the supporters. They can just to pull data from this repository and the only integration manager can handle the supposed to. And the cars tries to push through this positive. So height wars developers push their charges toe Special public repository integration manager pulls to these data from repository checks. If ever Siddiqui Circe usually his manager do not create court right? When Africa is a key, he can push his data to blast repository after that old of Arab developer scandal receives the latest data from this blast repository. This approach can works very good for distributed teams when there in different locations and can discuss hopped organize work. Really, From my experience, I didn't use such approach, but it can work. Another similar approaches. This one is dictator and the afternoon's work for its very similar. The only one difference that because subject like Brooksie, with a few left months which receives data from your developers and does that pushes data to dictator and deserve it because the same blast repository and all the dictator has rights to poor state toe disa poster it This approach works for really huge projects. For example, a Sino leanings colonel is right return using this approach because a lot of developers it might be for open source when you have a lot of developers different and you need to handle some houses bashed request. So every developer, they has their own accident and they pushers pushes. They dated to this left in, and he or she results conference and pushes data to dictator and dictator, has the final version off the court and to just hey can push to this blast repository and that developers get updated version for of this blast repository and one more approach. It's a fork and work full. It's the base for get hop approach, so how can we do? It works very well for open source projects. Also, we have origin original Repository on top, and you have original developer who created such approach such repository, and it sums some popular and important model and disease. The Alper doesn't want to share access to the positives. Other developers in this case, Ossa developers I can creative for cough the depositor, for it's a copy off your repository. They just fork fork your repository, and they can create a different couple, commits with some functionality or fix bark. Fixes are some additional solutions, and then they create a full request who request it sounds like commit but in get hub approach and they created pull request will with all these committees, and this poor request is signing this original developer and dissent developer can't decide is this. Changes are key And if everything is finally, he can pull these data and mercy into the original repository and get hopping towards very easy. Because is one partner which can creek, which you can quick and all data from fork Fork repository, this committee or, in our case, poor request is a few Commies will be pushed into your positive from my experience I used is this approach. When I worked with the get hub and bother repository and contributed Toe one library which is used for it's the Great Library and when we needed to create some contribution before repository created are a solution created pull request at that my nationally waas Okay court was reviewed. This pull request was March 2. Original repository it was last branch could set stretching, I want to mention so based on this you can decide what strategy you are going to use and in this case in it, consider ah, the size of your team and rice to repository or a project. Do you have rise to push a your poster or you need create your own fork and does that great bull requested this supposed to room on da It's This topic is also popular only interview for interview questions. And if you're goingto has high material for some companies, somebody can ask you about different branches strategies and how does it work and how it effects on your project and time off developing your project. So this is thank you for Washington. 22. And one more: in Syria. I want summarize our course and get a few options. What you can do the next. So, first of all, I would recommend it to read two great books. It's pro get and version control is get so the 1st 1 It's absolutely free and you can find it on Get site gets that you can go to pro get and here you can find this book. You can download it for Be There for Murder or for Your Turning book. And here is described a lot of additional information height works, height, work inside hard work with it hard with different tools. It's really great toe. It's really great book. Also, this another book, which you can find on happens off. It's not free, but anyway it very useful and is it would be if you reach awesome so and the here I added a few additional comments. You can try to use it. It is CEO. I will not show you how it works, but you can copy this comments and try on your product, or or you can read about this project in these books or Internet, so the 1st 1 is getting it from the beginning. This course I showed how we can cologne repository from your poster. Savory was good hop, but sometimes you can just create the or get a local machine and not connected to remote repository. And when you call getting eating it, just create, get hop, get you, create it repository on your machine results. Remote servers also already used to comments for configure your name, email and these and these one more. It's a core digital by default. Asi, remember, get opens a through we, but it's very old and the best options. So here you can configure past your editor and they call for the chapel Sublime or a bad? What's possible Next? Comment. Get damaged and show you can put Pasto file, and it was over who edited this file. Who and when. Also, the next one's bisect Itt's Well, I've toe apply binary search for your poster. So, for example, if you can't park in some commit and this committee was made between a couple of months and a lot off, commit these oppression will help you in a few steps to find thes to meet the next. Why, it's looks way already use pretty one mine. It shows the small version off look, and also you can try to run through this graph right after you could build the whole beat repositories structure with branches on your council. Also, you can create your own errors. Comments, for example, here is a great new common because Lost and then when you called it last, it will show you one last Commit from your positive. Also, if you can show your local between two branches difference these monster and your experiment or feature branch, it's the feature name. Next one is where dangerous combat. It's filter branch and it Wasit toe by some comment. Teoh this tree, for example, because removed possible txt file former oh or whiles in your pre. That's measures that you created much request and these these files while with the passport or some security information, and it should be deleted. So this common Candra room and remove these information from history and nobody will find finds this information, but the what do you need to be careful? It's really dentist to the comments, so I would recommend it to create a copy of your post story and Ron's this common there and if everything will be OK, you can run it on your old because I say Manchurian Juliet's history from the repository the next one. It's a very interesting comment rhetoric. It means reuse recorded resolution so UGT can specify some partners off your court. Harwich in the result. And they get you when it will find this partners, it can resolve conflicts automatically and is the last one. It's a sub model. It allows you to create a teacher. Depositors inside the your git repository. Yes, it's possible. And there you can try it after this course. So and this is from my side and I would recommend it to dry things, commerce and do not stop learning and a lot of services new in the next courses. See, thank you for Washington.