1
00:00:00,000 --> 00:00:10,560
In the previous video, you learned how to work with branches, but we didn't merge the

2
00:00:10,560 --> 00:00:16,400
changes yet. So how do you do that? Well, after making changes to a branch, the changes

3
00:00:16,400 --> 00:00:20,840
can be merged in the main branch. That is what you normally do when everybody is all

4
00:00:20,840 --> 00:00:26,719
right with your change. First, it's a good idea to have a look at the differences. So

5
00:00:26,719 --> 00:00:31,600
use git diff main new files to check the differences between the main branch and the

6
00:00:31,600 --> 00:00:37,560
new files branch. After using git checkout main, you're back in the main branch, and

7
00:00:37,560 --> 00:00:43,200
you can use git merge new files to apply changes from the branch to the main branch. If files

8
00:00:43,200 --> 00:00:48,360
have been modified to multiple branches, it's more complex because automatic merges are

9
00:00:48,360 --> 00:00:55,119
not possible when merge conflicts exist. And in such a case, the conflicts must be resolved

10
00:00:55,160 --> 00:01:01,279
manually by editing the affected files. And that's not easy. Now, continuing on the

11
00:01:01,279 --> 00:01:06,239
preceding demo, you can use git merge new files to merge changes from new files in the

12
00:01:06,239 --> 00:01:11,879
main branch. Let me show you. So to start it, I'm using git status, which is showing

13
00:01:11,879 --> 00:01:18,320
that we are in main, and I'm going to use git diff main new files. And there we can

14
00:01:18,320 --> 00:01:26,919
see that in diff there is this 3.txt, and that does not exist. So I'm going to use git

15
00:01:26,919 --> 00:01:37,120
merge new files. And then when I use ls, there you can see 3.txt does exist. And that is

16
00:01:37,120 --> 00:01:40,800
how you merge these branches. And from here on, it's business as usual.

