How to resolve merge conflicts in Visual Studio Code | Fast tutorial 2020

How to resolve merge conflicts in Visual Studio Code | Fast tutorial 2020


How to resolve merge conflicts in Visual Studio Code | Fast tutorial 2020

This quick git tutorial shows you how to resolve merge conflicts in VS Code. This tutorial has an example of a merge conflict in Visual Studio Code after pulling master. I explain the difference between Accept Incoming Change and Accept Current Change. For more quick tutorials, check out my other fast git / VS Code tutorials! Thank you for watching!!

How to use git in Visual Studio Code:    • How to use git in Visual Studio Code …  


Content

0.149 -> Today I will show you how to resolve merge conflicts in VS Code.
4.45 -> In this example, there is some text on master's README that says: "This is some text on master."
14.369 -> On my local branch, however, and I'm on master, I went ahead and committed some text here
21.06 -> that says: "This is some text on my local branch."
25.39 -> And I've already made a commit, as you can see here, in this bottom lefthand notation
31.35 -> here, an arrow pointing up with the number 1.
35.61 -> So what I want to do now is merge this GitHub version into my local version of this repo.
49.29 -> So I just type in "git merge master" and, it says "Already up to date."
56.6 -> because I haven't pulled.
58.53 -> So I'm gonna do "git pull" And as you can see it populates with a merge conflict.
67.32 -> So what it just tried to do is merge GitHub's version of this README into my local branch.
77.37 -> As you can see, there is some merge conflicts here.
81.96 -> Accept Current Change is this green block over here, so that would be: "This is some
89.08 -> text on my local branch."
91.36 -> Accept Incoming Change would be "This is some text on master" -- the one that we see on
97.78 -> GitHub.
99.94 -> I want to keep my local branch up to date with master so I would do Accept Incoming
107.35 -> Change in this situation.
110.87 -> But of course you can explore these other options depending on the situation you're
116.29 -> in.
117.29 -> Maybe your code is ahead of master and you wanna save your code.
121.21 -> So I'm gonna do Accept Incoming Change.
124.79 -> And merge conflict files will show this purple C in the git tab.
131.009 -> You have to save the file.
132.54 -> I'm just doing command + S and that little dot went away because I just saved this file.
139.099 -> After that I just stage it and use command + enter on Mac to make another commit.
146.599 -> And then after that, I can push up my changes to GitHub.
152.069 -> And that's it!
153.18 -> That's how you resolve merge conflicts in git using vs code.
159.26 -> VS Code makes it really easy and I hope you use this tutorial in your everyday workflow.
165.799 -> Don't forget to like this video and subscribe for more short tutorials.
171.39 -> I really enjoy making these and can't wait to make more.
175.79 -> So thank you! for watching.
177.87 -> Don't forget to check out my other git tutorials if you're interested.

Source: https://www.youtube.com/watch?v=QmKdodJU-js