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,440 changes yet. So how do you do that? Well, after making changes to a branch, the changes 3 00:00:16,440 --> 00:00:20,879 can be merged in the main branch. That is what you normally do when everybody is all 4 00:00:20,879 --> 00:00:26,760 right with your change. First, it's a good idea to have a look at the differences. So 5 00:00:26,760 --> 00:00:31,559 you can use git diff main new files to check the differences between the main branch and 6 00:00:31,559 --> 00:00:37,560 the 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,119 --> 00:01:01,919 manually by editing the affected files. And that's not easy. Now, continuing on the preceding 11 00:01:01,919 --> 00:01:07,199 demo, you can use git merge new files to merge changes from new files in the main branch. 12 00:01:07,199 --> 00:01:12,320 Let me show you. So to start it, I'm using git status, which is showing that we are in 13 00:01:12,320 --> 00:01:20,360 main, and I'm going to use git diff main new files. And there we can see that in diff, 14 00:01:20,360 --> 00:01:30,680 there is this 3.txt, and that does not exist. So I'm going to use git merge new files. And 15 00:01:30,680 --> 00:01:37,959 then when I use ls, there you can see 3.txt does exist. And that is how you merge these 16 00:01:37,959 --> 00:01:40,800 branches. And from here on, it's business as usual.