It's time to one simple example of how Git merge works. And I need to repeat myself on my previous slides, but I think it's important to talk again and again involved with Marsha and be very helpful for you to musters is important commands. And so, simple example, let's say that you're creating an official branch of master for new features that you want to quote, and you finish working on the official branch. And the same time your colleague, some team member, made some changes as the main master branch. And before creating pull requests. You might want to talk a bit about WordPress and it's actually a separate place where developers can Create mesh and talk together about the changes into my want to ensure that you have the most updated version of code from my server into as your featured image.
And there are a couple of ways to do this get mentioned and it's your basic so mentioned in watches let's say Bob that much like yours should tell him get get this wrap all mine You changes certain made and puts it into existing changes. And if you cannot figure out how to combine them together, ask me to resolve the conflicts and how it works. Let's say Linda is how to create an empty repository is a text file and she adds to it Hello This file ends commits changes, and renamed as changes like C one. And InDesign realize that she should add more to this file and shares. This is a sentence at 70. So in a world to look like this zero step, master branch and follow a world to the second sentence and commit three looks like this.
So let's commit second. Then Linda decides that she wants to add even more concepts into this file. So she created a branch so she created feature mock on this branch, and she adds an entire file from branch and a sentence to the Hello World file and images changes at CES this time Another developer decides that into a place of master this is a sentence with this second line and she commits no changes at master default. And on master hello world looks like this master bench and hello world this is second floor it was second sentence. But on feature branch in the file, it looks like some load is a second sentence and another sentence to be had dates. That was my master interview who should mention, Linda could merge master into your feature branch and the last commit on master see for is not an assessor of the latest commits that Linda mate Richard mentioned.
So they cannot be combined together because it's like separated lines into history. In order to resolve, she will need to create another comment, additional comments not to merge those changes. So when you're on when children show nurse common, she'll have another comment that will have most comments that was made before C suite and C for aspirants. And it's create one comment that actually combined changes and both branches for souls in the comments, it gives to do it in that through and merge between the tips of the two branches and it's called this so it sexually only one common sets usually have to parent usually comments have one but as you can see here, or here so now Hello worlds looks like this at master branch after two emotionless looks like this a second one and another sentence. So another sentence came from future adventure. Okay, a bit of summary.
So measure, do not revise history. And if you want to keep an accurate representation of your repository without losing any work, and history, merging might be the best way to go. However, historical history might looks a bit compromising because sometimes you're cheating Just divergence and it's kind of emerged and using merger as a primary means of integration might be more work in progress on this and we'll talk at next slide also, about it much more details. See