
How to resolve merge conflict using Visual Studio Code
How to resolve merge conflict using Visual Studio Code
Git conflict is a common scenario arises when multiple people changes the same file. This video is how to overcome such scenarios and fix merge issue using VS code
Resolve git using Intellig : • How to resolve git conflict or git me…
------------------------------------------------
Follow me on:
►Youtube : https://bit.ly/2W1X7zz
►Facebook : / e.codespace
►LinkedIn : / gourabpaul
►Twitter : / gourab_p
-----------------------------------------------
#git #gitMerge
Content
0.03 -> resolving March conflict is one of the
biggest issue when multiple peoples are
4.68 -> working on the same project and
sometimes it becomes a nightmare
9.12 -> in our previous tutorial we have seen
how to resolve merge conflict using
13.41 -> IntelliJ and in this tutorial we will do
the same that is resolved merge conflict
18.57 -> but by using Visual Studio code
27.289 -> so we have cloned the project using git
bash and opened the project in Visual
32.969 -> Studio code this is JavaScript angular
project inside SRC app dot component HTML
40.26 -> we will add comment in the last line
60.14 -> similarly we will add comments in app dot
component dot CSS file
81.77 -> let's say the files are changed by
person a1
99.04 -> and same goes for HTML file too copy and
paste and on component.ts we will
108.79 -> add a function hello which logs hello
world and these changes are made by same
114.52 -> person a 1 we can open terminal from
here or using ctrl + tilde
120.34 -> now let's mock the change made by other
person so we will directly go and update
126.91 -> in git repository under SRC app folder
app component dot TS
141.18 -> we will add a function calculate which
takes two parameter x and y and prints
148.57 -> the summation of x and y
158.93 -> let's commit the changes
166.37 -> and then we'll update the CSS file too
181.5 -> and add a comment changes made by person
b2 and commit the changes person b2 has
190.11 -> made changes in two files
whereas person a1 has made changes in
194.31 -> three files so in Visual Studio code we
have saved the changes made in all three
199.62 -> files
let's run git add all then get commit -
206.55 -> M the commit message that is added hello
world
213.78 -> let's push the change from local
repository to remote master branch using
218.85 -> git push
228.05 -> user ID password
234.65 -> we can see that it got rejected and need
to pull the remote changes before
239.959 -> pushing
243.6 -> let's run git pull and we can see the
merge conflict occurred so from
250.18 -> integrated get tool bar we can see which
files have March conflict we have both
256.27 -> CSS and TS file here we can compare side
by side by clicking compare changes
263.16 -> though this will not make any change in
the file
271.13 -> we can keep both the changes or accept
only current change let's undo or change
278.57 -> made by person B 2 which is the incoming
change
284.17 -> similarly for app component ts we will
keep both the changes that is function
289.61 -> hello world of person a 1 and calculate
returned by person B 2 let's save all
295.52 -> the files then get add
300.169 -> git commit with message fixed merge
conflict
307.43 -> then get push user ID password and we
can see it is successful let's verify it
314.93 -> so we can see both the files are merged
and the third file changes are not here
319.61 -> because those are March to master in
previous commit that's all for this
324.889 -> tutorial
don't forget to hit the like button
327.139 -> share and subscribe to code space for
any queries right in the below comment
331.34 -> section thanks for watching
Source: https://www.youtube.com/watch?v=kBIMGOxqqnk