RUVIDEO
Поделитесь видео 🙏

Section 7 (GitHub): Lesson 4 - Conflicts and ignore

Hey you and welcome.

In this video we will look at conflicts and gitignore for secret management.

So let's dive right into it.

First things first.

What is a conflict?

So I'm going to create a conflict right now and show you that first hand.

In order to create a conflict, I need to have two branches.

So my main branch is there.

I'm going to leave that alone.

I'm going to create a whole new branch and call it Branch A.

So that's my branch A created.

Next I'll create another branch.

Call it Branch B.

Perfect.

Now I have two branches.

A conflict in GitHub would be that two branches making changes to the same file, maybe even the same

line.

And then those two branches try to merge together or merge into another branch right after another and

that could create conflicts.

So let's see how that works.

I'm going to go to Branch A and open this in VS code.

I'll make a change to console.log here and say world.

Save that, go to GitHub desktop and make that update.

Updated index.js and I'll commit that change and I'll publish that.

Perfect.

So that's number one.

Now, Branch B.

I'll open that in VS code as well.

And you see how it changed to Hello again because I've changed the branch.

So this branch will say instead of world it would be just earth.

Save that.

Go back to my GitHub desktop.

Updated Index.js.

Commit and publish.

Perfect.

So this should create a conflict for me on the GitHub.

So if I go back to my firefox and you can see there's a few branches, so if I create a pull request

at this point, I'll create a new pull request using branch A.

It's able to merge.

No conflicts just yet.

I'm going to create this pull request, keep the message as is and click on Create pull request.

Great.

Now let's go back to pull request section.

Create another pull request using branch be.

And create pull request.

Create.

Pull.

Request.

Great.

All right.

Looking good so far.

Two branches, both of them able to merge.

No conflicts just yet.

Now watch what happens when I merge Branch A, which I believe is this one branch a perfect.

I can merge it into main right now.

Merge it done.

And I'll delete the branch.

No more use for that anymore.

And if I go back to pull request, go back to updated index if I scroll down.

I can see that there's now a conflict.

Now there's two ways to resolve the conflict.

One way would be to use the web UI for GitHub, where you can see there's a button called resolve conflicts.

If I click on it, it will show me what a conflict is and this is one way to do it.

I, however, would pick the local way to do it because that way your your branches don't get messed

up.

What I mean by that is if you make the changes here, eventually your local branch will be outdated

and that can create problems When you try to push new changes or pull any requests, any, any update

information so that can create some problem.

Chances are local would be better.

So I'm not going to use this, but there is a there is a way to do that on GitHub UI.

I'm just not going to use that functionality.

I'll go back to my GitHub desktop.

And go to Main Branch.

And let's pull.

Fetch Origin.

Pull Origin.

Great.

With that done, now let's switch over to Branch B.

And after switching over at the bottom, you can see there's an option.

Choose a branch to merge into branch B, So chances are you don't want to resolve conflicts on the main

branch.

That's the working branch.

Everybody should just be working out of that and there should be no conflicts there.

So best way to do it is to resolve the conflicts on a separate branch, on a different branch outside

of Main, in this case Branch B So I'll do that.

I'll click on this and I'll say Merge main into there and it will say there are there will be one conflicted

file when you want to merge.

So I'll say create a merge commit and now the resolution needs to happen.

So I'll say open this in Visual Studio and you can see this is a much nicer UI for me to work with.

It's highlighted to say the changes, current changes that you have on Branch B are so on, Hello earth

and then the changes that are incoming from the other branch says Hello world, which one would you

like to use?

And at the top of this you can see there's a few options for me to work with.

I'll add my file Explorer.

The options are accept current changes.

That means hello Earth goes in or accept incoming changes or accept both.

That means both console logs can exist and you can just keep both of them.

In this case, I'll work with incoming changes, so accept incoming change.

Perfect.

And save that file.

If I go back to now GitHub desktop and I'll say continue merge, no conflicts remaining, make sure

that message shows up and I'll say commit merge.

And once that is done, I can push that.

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Section 7 (GitHub): Lesson 4 - Conflicts and ignore», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.